home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / tex / gentle~1.zoo / gentle_intro.tex
Text File  |  1991-09-14  |  193KB  |  5,336 lines

  1. %% file : gentle_intro.tex
  2. %% Thanks for your interest in A Gentle Introduction to TeX.
  3. %% Any comments on this manual would be appreciated. These may
  4. %% be typesetting, English, or TeX criticisms. If you decide to
  5. %% translate this document into another language, I'd appreciate
  6. %% receiving a copy.
  7. %%
  8. %% This file is a complete TeX input file.  Just run it
  9. %% through TeX and print out the resulting "DVI" file. If you are
  10. %% familiar with TeX, the macros at the top of the file have a few
  11. %% switches which you may want to set.  If you have problems or
  12. %% can't run TeX at all, write to me and I'll send you a hard copy.
  13. %%
  14. %% You should feel free to photocopy and/or distribute this manual.
  15. %% My only request is that it remain in one piece and not be chopped
  16. %% up.  The only machine dependent section (#1.2) may need to be
  17. %% rewritten for your local site, of course.
  18. %%
  19. %%%                Michael Doob
  20. %%                 Department of Mathematics
  21. %%                 The University of Manitoba
  22. %%                 Winnipeg, Manitoba  R3T 2N2
  23. %%                 Canada
  24. %%                 mdoob@uofmcc                    (bitnet)
  25. %%                 mdoob@ccu.umanitoba.ca          (internet)
  26. %%
  27. %% Here is a character listing to check to be sure that no
  28. %% unwanted translations took place within the bowels of the net.
  29. %% Upper case letters: ABCDEFGHIJKLMNOPQRSTUVWXYZ
  30. %% Lower case letters: abcdefghijklmnopqrstuvwxyz
  31. %% round parentheses, square brackets, curly braces: ()  []  {}
  32. %% Exclaim, at, sharp, dollar, percent: ! @ # $ %
  33. %% Caret, ampersand, star, underscore, hyphen: ^ & * _ -
  34. %% vertical bar, backslash, tilde, backprime, plus: | \ ~ ` +
  35. %% plus, equal, prime, quote, colon: + = ' " :
  36. %% less than, greater than, slash, question, comma: < > / ? ,
  37. %% period, semicolon: . ;
  38. %%
  39. %%
  40. %%
  41. %% Now here come the macros used in this manual. If you are already
  42. %% already familiar with TeX, you may want to fiddle with them.
  43. %% In particular, the hooks are left to generate a new control
  44. %% word index and table of contents if you change section 1.2.
  45. %%
  46. %% Updated 01/04/90
  47.  
  48.  
  49.  
  50. %%%%%%%% Here are the fonts other than the sixteen defined in %%%%%%%%
  51. %%%%%%%%%%%%%        plain.tex that are used        %%%%%%%%%%%%%%%%%%
  52.  
  53.        %%%% first, choose between amr or cmr fonts %%%
  54. \newif \ifamrfonts
  55. \amrfontsfalse  % use this line if you use the cmr fonts
  56. %\amrfontstrue  % use this line if you use the old armfonts
  57.  
  58. \ifamrfonts \font\brm=amr10 scaled \magstep1
  59.       \else \font\brm=cmr10 scaled \magstep1 \fi
  60. \ifamrfonts \font\halfrm=amr10 scaled \magstephalf
  61.       \else \font\halfrm=cmr10 scaled \magstephalf \fi
  62. \ifamrfonts \font\bbrm=amr10 scaled \magstep2
  63.       \else \font\bbrm=cmr10 scaled \magstep2 \fi
  64. \ifamrfonts \font\bbbrm=amr10 scaled \magstep3
  65.       \else \font\bbbrm=cmr10 scaled \magstep3 \fi
  66. \ifamrfonts \font\bbbbrm=amr10 scaled \magstep4
  67.       \else\font \bbbbrm=cmr10 scaled \magstep4 \fi
  68. \ifamrfonts \font\bbbbbrm=amr10 scaled \magstep5
  69.       \else \font\bbbbbrm=cmr10 scaled \magstep5 \fi
  70. \ifamrfonts \font\sf = amssmc10
  71.       \else \font\sf = cmss10 \fi
  72. \ifamrfonts \font\chapfont=ambx10 scaled \magstep2
  73.       \else \font\chapfont=cmbx10 scaled \magstep2 \fi
  74. \ifamrfonts \font\secfont=ambx10 scaled \magstep1
  75.       \else \font\secfont=cmbx10 scaled \magstep1 \fi
  76. \ifamrfonts \font\sc= amcsc10
  77.       \else \font\sc= cmcsc10 \fi
  78. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  79.  
  80.  
  81. %%%%\vbadness=10000 %%%%%% I don't want to hear about underfull vboxes
  82. \raggedbottom      %%%%% delete this line for aligned page bottoms
  83. \hsize=5.5in
  84. \vsize=7in
  85. \voffset=.75in
  86. \parskip=\baselineskip
  87. \widowpenalty=1000 \clubpenalty=1000  %%% I hate widows and orphans! %%%
  88.  
  89. %%%%%%%%% choosing between Canadian and American spellings %%%%%%%%%
  90. \newif \ifcanspell
  91. \canspelltrue      %%%% Canadian spelling
  92.  \canspellfalse    %%% use this line for American spelling
  93.  
  94. \def\aesthetic{\ifcanspell \ae{}sthetic\else esthetic\fi}
  95. \def\analogue{\ifcanspell analogue\else analog\fi}
  96.      \let\analog=\analogue
  97. \def\cancelled{\ifcanspell cancelled\else canceled\fi}
  98.      \let\canceled=\cancelled
  99. \def\centimetre{\ifcanspell centimetre\else centimeter\fi}
  100.      \let\centimeter=\centimetre
  101. \def\centre{\ifcanspell centre\else center\fi}
  102.      \let\center=\centre
  103. \def\centred{\ifcanspell centred\else centered\fi}
  104.      \let\centered=\centred
  105. \def\our{\ifcanspell our\else or\fi}
  106. \def\postcode{\ifcanspell postalcode\else zipcode\fi}
  107. \def\province{\ifcanspell province\else state\fi}
  108. \def\theatre{\ifcanspell theatre\else theater\fi}
  109.      \let\theater=\theatre
  110. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  111.  
  112.  
  113. %%%%%%%%%%%%%%%%%%%%%%% headline routines %%%%%%%%%%%%%%%%%%%%%%%%%%%%
  114. \def\gentleheadline{%
  115.     \vbox {\hrule%
  116.         \line {\strut \vrule \quad \tenrm A \TeX{} intro
  117.               \ifcanspell (Canadian \else (U.S. \fi spelling)
  118.               \hfil
  119.               \ifnum \secnum > 0 Section \the\secnum: \fi \sectiontitle \quad
  120.               \vrule}%
  121.         \hrule}%
  122. }
  123.  
  124. \newif \iftitlepage    \titlepagetrue
  125. \headline=
  126.   {\iftitlepage \hfil \global\titlepagefalse \else \gentleheadline \fi}
  127. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  128.  
  129. %%%%%%%%%%%%%%%%%%%% define contents and index files %%%%%%%%%%%%%%%%%%%%%%
  130. %%% Normally the contents and index are hard coded into the input file. %%%
  131. %% To generate new ones, use \writingcontentstrue and \writingindextrue. %%
  132.  
  133. \newif \ifwritingcontents
  134. \newif \ifwritingindex
  135. \newwrite\contents         \newwrite\index
  136.  
  137. \writingcontentsfalse      \writingindexfalse
  138. %%% \writingcontentstrue  %%% use this line to make the contents
  139. %%% \writingindextrue     %%% use this line to make the index
  140.  
  141. \ifwritingcontents \openout\contents=contents.tex     \fi
  142. \ifwritingindex \openout\index=index.tex
  143.           \def\toindex#1{\immediate\write\index{#1 \the\pageno}}
  144.           \else \def\toindex#1{} \fi
  145. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  146.  
  147. %%%%%%%%%%%%%%%%%%%% determine whether answers are printed %%%%%%%%%%%%%%%%
  148. \newif \ifwritinganswers
  149. \writinganswersfalse        %%% use this line to suppress answer section
  150. \writinganswerstrue         %%% use this line to include answer section
  151. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  152.  
  153. %%%%%%%%%%%%%%%%      footnote macro with counter      %%%%%%%%%%%%
  154. \newcount\footnotenum \footnotenum=0
  155. \def\fnote#1{\advance \footnotenum by 1%
  156. \footnote{$^{\the\footnotenum}$}{#1}}
  157. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  158.  
  159.  
  160.  
  161. %%%%%%%%%%%%%%%% exercise, section, and subsection macros %%%%%%%%%%%%
  162. \newcount\exno                   %%%%%% counter for exercises %%%%%%%%
  163. \newcount\secnum \secnum=0       %%%% counter for section numbers %%%%
  164. \newcount\subsecnum
  165.  
  166. \def\section#1{
  167.             \vfill\eject %%%%% new section starts on a new page
  168.             %%%\ifodd\pageno \else\ \vfill\eject \fi %start on an odd page
  169.             \advance\secnum by 1 \subsecnum=0 \exno=0
  170.             \ifnum \secnum = 1 \pageno=1 \fi
  171.             \ifnum \secnum > 0
  172.                  \leftline{\chapfont Section \the\secnum}
  173.                  \vskip 3pt \fi
  174.             \leftline{\chapfont #1}
  175.             \def\sectiontitle{#1}
  176.             \vskip\baselineskip
  177.             \hrule
  178.             \vskip 1cm
  179.             \ifwritingcontents \write\contents{\string\line\string{#1
  180.                    \string\dotfill{}
  181.                    \ifnum \pageno < 0 \romannumeral-\pageno
  182.                    \else \the\pageno \fi
  183.                    \string}}\fi
  184.             \titlepagetrue}
  185.  
  186. \def\subsection#1{\advance\subsecnum by 1
  187.                \vskip 30pt
  188.                \leftline{\secfont \the\secnum .\the\subsecnum\ #1}
  189.                \nobreak
  190.                \ifwritingcontents
  191.                  \write\contents{\string\line\string{\string\qquad{}#1
  192.                 \string\dotfill{} \the\pageno\string}}\fi
  193.                  }
  194.  
  195. \def\exercise{\global\advance \exno by 1
  196.          \vskip\baselineskip
  197.          \noindent $\triangleright$ Exercise \the\secnum.\the\exno\quad
  198.          }
  199. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  200.  
  201.  
  202. %% definitions of control sequences for characters in the typewriter font %%%
  203. %%%% for short phrases this is easier than using a literal construction %%%%
  204. \def\\{\char92{}}          %%%%% backslash %%%%%
  205. \def\lb{\char'173{}}       %%%%% left brace %%%%%
  206. \def\rb{\char'175{}}       %%%%% right brace %%%%%
  207. \def\sp{\char32{}}         %%%%% special space symbol %%%%%
  208.  
  209. \def\beginliteral{
  210. \vskip\baselineskip
  211. \begingroup
  212. \tt
  213. \obeylines
  214. %{\obeyspaces\global\let =\ }
  215. \catcode`\@=0
  216. \parskip=0pt\parindent=0pt
  217. \catcode`\$=12\catcode`\&=12\catcode`\^=12\catcode`\#=12
  218. \catcode`\_=12\catcode`\~=12
  219. \def\par{\leavevmode\endgraf}
  220. \catcode`\{=12\catcode`\}=12\catcode`\%=12\catcode`\\=12
  221. }
  222.  
  223. \def\endliteral{\endgroup}
  224. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  225.  
  226.  
  227. %%%%%%%%%%%%%% inhibit hyphenation of typewriter text %%%%%%%%%%%%%%
  228. \hyphenchar\tentt=-1
  229.  
  230.  
  231. %%%%%%%%%%%% grouping to make input listing in typewriter type %%%%%%%
  232. \def\beginuser{\vskip\parskip
  233.                \everypar={\nobreak}
  234.                \begingroup
  235.                \tt \obeylines \parskip=0pt \parindent=0pt}
  236.  
  237. \def\enduser{\endgroup}
  238.  
  239.  
  240. %%%%%%%%%%% macro to construct tables (easily) %%%%%%%%%%%%%%%%
  241. %%% parameters: title goes between brackets, rest of the
  242. %%%             paragraph is the table
  243. \def\maketable[#1]#2\par{
  244. \setbox1=\vbox{#2}
  245. $$\vbox{
  246.         \hbox to \wd1{\bf \hss #1 \hss}
  247.         \vskip 12pt
  248.         \box1
  249.        }
  250. $$
  251. }
  252. %%%%%%%%%%%  end of macro to construct tables  %%%%%%%%%%%%%%%%
  253.  
  254.  
  255.  
  256. %%%%%%%%%%% macro to put a box around the text %%%%%%%%%%%%%%%%
  257. \def\makebox#1#2#3% vsize, hsize, inserted text
  258. {\hbox{\vrule
  259.        \vbox to  #1{\hrule \vss
  260.                    \hbox to #2{\hss#3\hss}\vss
  261.                    \hrule}\vrule}}
  262.  
  263. \def\displaytext#1{$$\hbox{#1}$$}
  264.  
  265. \def\LaTeX{{\rm L\kern-.36em\raise.3ex\hbox{\sc a}\kern-.15em
  266.    T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
  267.  
  268. \def\AMSTeX{{$\cal A$}\kern-.1667em\lower.5ex\hbox
  269.  {$\cal M$}\kern-.125em{$\cal S$}-\TeX}
  270.  
  271.  
  272. %%%%%%%%%%%% macro to put TeX references in right margin %%%%%%%%
  273. \newdimen\theight
  274. \def \TeXref#1{%
  275.              \vadjust{\setbox0=\hbox{\sevenrm\quad\quad\TeX book: #1}%
  276.              \theight=\ht0
  277.              \advance\theight by \dp0    \advance\theight by \lineskip
  278.              \kern -\theight \vbox to \theight{\rightline{\rlap{\box0}}%
  279.              \vss}%
  280.              }}%
  281. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  282.  
  283. \def\version{1.0}
  284.  
  285. %%%%%%%%%%%% macro to write the date out the date and time %%%%%%%%%%%
  286. %%%%%%%%%%%%          TeXbook   p. 406 for date            %%%%%%%%%%%
  287. \def\today{\ifcase\month\or January\or February\or March\or April\or
  288. May\or June\or July\or August\or September\or October\or November\or
  289. December\fi \space\number\day, \number\year}
  290.  
  291. \newcount\hour \newcount\minute
  292. \hour=\time  \divide \hour by 60
  293. \minute=\time
  294. \loop  \ifnum \minute > 59 \advance \minute by -60 \repeat
  295. \def\writetime{\ifnum \hour<13 \number\hour:%  % supresses leading 0's
  296.                       \ifnum \minute<10 0\fi%  % so add it it
  297.                       \number\minute
  298.                       \ifnum \hour < 12 \ A.M. \else \ P.M. \fi
  299.       \else \advance \hour by -12 \number\hour:%  % supresses leading 0's
  300.                       \ifnum \minute<10 0\fi%     % add it in
  301.                       \number\minute \ P.M. \fi}
  302.  
  303. \def\datestamp{\vfill
  304.     \rightline{\sevenrm Gentle Intro \version{} run through \TeX{}
  305.                on \today{} at \writetime}}
  306. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  307.  
  308. \titlepagetrue
  309. {\nopagenumbers
  310. \def\sectiontitle{Introduction}
  311. \topinsert \vskip 6 cm \endinsert
  312. \centerline{\chapfont A Gentle Introduction to \TeX{}}
  313. \vskip 15 pt
  314. \centerline{\secfont A Manual for Self-study}
  315. \vskip 3cm
  316. \leftline{Michael Doob}
  317. \leftline{Department of Mathematics}
  318. \leftline{The University of Manitoba}
  319. \leftline{Winnipeg, Manitoba, Canada R3T 2N2}
  320. \vskip\baselineskip
  321. \leftline{MDOOB@UOFMCC.BITNET}
  322. \leftline{MDOOB@CCU.UMANITOBA.CA}
  323.  
  324. \vfill\eject
  325. \titlepagetrue.
  326. \vfill\eject
  327. }
  328. \secnum=-2 \pageno=-1
  329.  
  330. \section{Introduction}
  331.  
  332. First the bad news: \TeX{} is a large and complicated program that
  333. goes to extraordinary lengths to produce attractive typeset material.
  334. This very complication can cause unexpected things to happen at times.
  335. Now the good news: straightforward text is very easy to typeset using
  336. \TeX\null.  So it's possible to start with easier text and work up to
  337. more complicated situations.
  338.  
  339. The purpose of this manual is to start from the very beginning and
  340. to move towards these more complicated situations.  No previous knowledge
  341. of \TeX{} is assumed. By proceeding a section at a time, greater
  342. varieties of text can be produced.
  343.  
  344. Here are a few suggestions: there are some exercises in each
  345. section.  Be sure and do them! The only way to learn \TeX{} is
  346. by using it.  Better yet, experiment on your own; try to make
  347. some variations on the exercises.  There is no way that you can
  348. damage the \TeX{} program with your experiments.  You can find a
  349. complete answer to most exercises by looking at the \TeX{} source
  350. file that was used to produce this document.  You'll notice that
  351. there are references in the right margin to {\bf The \TeX
  352. book}\fnote{Addison Wesley, Reading,Massachusetts, 1984, ISBN
  353. 0-201-13488-9}\null.  When you feel that you want more
  354. information on a topic, that's where to look.
  355.  
  356. Incidently, there are a few fibs that appear in this manual;
  357. they are used to hide complications (I look at this as something
  358. like poetic license).  As you become more experienced at using
  359. \TeX{}, you'll be able to find them.
  360.  
  361. \TeX{} is a public domain program that is available for no license
  362. fee.  It was developed by Donald Knuth at Stanford University as
  363. a major project.
  364. In the profit-oriented market place,
  365. the program would certainly cost many thousands of dollars.  The
  366. \TeX{} Users Group (TUG) is a nonprofit organization which distributes
  367. copies of \TeX{}, updates software, and gives information about
  368. new developments in both hardware and software in its publications
  369. TUGboat and \TeX niques.  Joining this users group is inexpensive;
  370. please consider doing so.  The address is:
  371. \vskip\baselineskip
  372. \centerline{\TeX{} Users Group}
  373. \centerline{P.O. Box 9506}
  374. \centerline{Providence, RI 02940}
  375. \centerline{U.S.A.}
  376.  
  377. This manual would not have come into being without the aid of others.
  378. In particular the proofreading and suggestions of the following
  379. people have been invaluable:
  380. \begingroup
  381. \frenchspacing
  382. Waleed A.~Al-Salam (University of Alberta),
  383. Debbie L.~Alspaugh (University of California),
  384. Nelson H.~F.~Beebe (University of Utah),
  385. Barbara Beeton (American Mathematical Society),
  386. Bart Childs (Texas A.~\&~M\null. University),
  387. Mary Coventry (University of Washington),
  388. Dimitrios Diamantaras (Temple University),
  389. Roberto Dominimanni (Naval Underwater Systems Center),
  390. Victor Eijkhout (University of Nijmegen),
  391. Moshe Feder (St. Lawrence University),
  392. Josep~M.~Font (Uviversidad Barcelona),
  393. Jonas de Miranda Gomes
  394.         (Instituto de Matematica Pura e Aplicada - Brazil),
  395. Rob Gross (Boston College),
  396. Klaus Hahn (University of Marburg),
  397. Anita Hoover (University of Delaware),
  398. J\"urgen Koslowski (Macalester College),
  399. Kees van der Laan (Rijksuniversiteit Groningen),
  400. John Lee (Northrop Corporation),
  401. Silvio Levy (Princeton University),
  402. Robert Messer (Albion College),
  403. Emily H.~Moore (Grinnell College),
  404. Young Park (University of Maryland),
  405. Craig Platt (University of Manitoba),
  406. David Roberts (Colorado),
  407. Kauko Saarinen (University of Jyv\"askyl\"a),
  408. Jim Wright (Iowa State University),
  409. and
  410. Dominik Wujastyk (Wellcome Institute for the History of Medicine).
  411.  \endgroup
  412.  
  413. In addition several people have sent me parts or all of their local
  414. manuals.  I have received a few others on the rebound.
  415. In particular
  416. \begingroup
  417. \frenchspacing
  418. Elizabeth Barnhart (TV Guide),
  419. Stephan v.~Bechtolsheim (Purdue University),
  420. Nelson H.~F.~Beebe (University of Utah)
  421.              and Leslie Lamport (Digital Equipment Corporation),
  422. Marie McPartland-Conn and Laurie Mann (Stratus Computer),
  423. Robert Messer (Albion College),
  424. Noel Peterson (Library of Congress),
  425. Craig Platt (University of Manitoba),
  426. Alan Spragens (Stanford Linear Accelerator Center, now of Apple Computers),
  427. Christina Thiele (Carleton University),
  428. and Daniel M.~Zirin (California Institute of Technology)
  429. \endgroup
  430. have written various types of lecture notes that have been most helpful.
  431.  
  432. \vfill \eject
  433. \section{Contents}
  434.  
  435. \line{Introduction \dotfill{} i}
  436. \line{Contents \dotfill{} iii}
  437. \line{1.~Getting Started \dotfill{} 1}
  438. \line{\qquad{}1.1 What \TeX{} is and what \TeX{} isn't \dotfill{} 1}
  439. \line{\qquad{}1.2 From \TeX{} file to readable output,
  440.                                         the big set up \dotfill{} 2}
  441. \line{\qquad{}1.3 Let's do it! \dotfill{} 4}
  442. \line{\qquad{}1.4 \TeX{} has everything under control \dotfill{} 7}
  443. \line{\qquad{}1.5 What \TeX{} won't do \dotfill{} 8}
  444. \line{2.~All characters great and small \dotfill{} 9}
  445. \line{\qquad{}2.1 Some characters are more special than others \dotfill{} 9}
  446. \line{\qquad{}2.2 Typesetting with an accent \dotfill{} 10}
  447. \line{\qquad{}2.3 Dots, dashes, quotes,
  448.        $\textfont0=\tenbf \mathinner {\ldotp \ldotp \ldotp }$ \dotfill{} 13}
  449. \line{\qquad{}2.4 Different fonts \dotfill{} 15}
  450. \line{3.~The shape of things to come \dotfill{} 19}
  451. \line{\qquad{}3.1 Units, units, units \dotfill{} 19}
  452. \line{\qquad{}3.2 Page shape \dotfill{} 20}
  453. \line{\qquad{}3.3 Paragraph shape \dotfill{} 22}
  454. \line{\qquad{}3.4 Line shape \dotfill{} 26}
  455. \line{\qquad{}3.5 Footnotes \dotfill{} 27}
  456. \line{\qquad{}3.6 Headlines and footlines \dotfill{} 28}
  457. \line{\qquad{}3.7 Overfull and underfull boxes \dotfill{} 29}
  458. \line{4.~$\Bigl\{$Groups, $\bigl\{$Groups,
  459.         $\{$and More Groups$\}\bigr\}\Bigr\}$ \dotfill{} 31}
  460. \line{5.~No math anxiety here! \dotfill{} 33}
  461. \line{\qquad{}5.1 Lots of new symbols \dotfill{} 33}
  462. \line{\qquad{}5.2 Fractions \dotfill{} 37}
  463. \line{\qquad{}5.3 Subscripts and superscripts \dotfill{} 38}
  464. \line{\qquad{}5.4 Roots, square and otherwise \dotfill{} 39}
  465. \line{\qquad{}5.5 Lines, above and below \dotfill{} 39}
  466. \line{\qquad{}5.6 Delimiters large and small \dotfill{} 40}
  467. \line{\qquad{}5.7 Those special functions \dotfill{} 41}
  468. \line{\qquad{}5.8 Hear ye, hear ye! \dotfill{} 42}
  469. \line{\qquad{}5.9 Matrices \dotfill{} 43}
  470. \line{\qquad{}5.10 Displayed equations \dotfill{} 45}
  471. \line{6.~All in a row \dotfill{} 48}
  472. \line{\qquad{}6.1 Picking up the tab \dotfill{} 48}
  473. \line{\qquad{}6.2 Horizontal alignment with more sophisticated patterns
  474.       \dotfill{} 51}
  475. \line{7.~Rolling your own \dotfill{} 55}
  476. \line{\qquad{}7.1 The long and short of it \dotfill{} 55}
  477. \line{\qquad{}7.2 Filling in with parameters \dotfill{} 57}
  478. \line{\qquad{}7.3 By any other name \dotfill{} 60}
  479. \line{8.~To err is human \dotfill{} 62}
  480. \line{\qquad{}8.1 The forgotten bye \dotfill{} 62}
  481. \line{\qquad{}8.2 The misspelled or unknown control sequence \dotfill{} 62}
  482. \line{\qquad{}8.3 The misnamed font \dotfill{} 64}
  483. \line{\qquad{}8.4 Mismatched mathematics \dotfill{} 64}
  484. \line{\qquad{}8.5 Mismatched braces \dotfill{} 65}
  485. \line{9.~Digging a little deeper \dotfill{} 68}
  486. \line{\qquad{}9.1 Big files, little files \dotfill{} 68}
  487. \line{\qquad{}9.2 Larger macro packages \dotfill{} 69}
  488. \line{\qquad{}9.3 Horizontal and vertical lines \dotfill{} 70}
  489. \line{\qquad{}9.4 Boxes within boxes \dotfill{} 72}
  490. \line{10.~Control word list \dotfill{} 77}
  491. \ifwritinganswers
  492.     \line{11.~I get by with a little help\dotfill{} 80}
  493. \fi
  494.  
  495.  
  496.  
  497. \section{Getting Started}
  498.  
  499. \subsection{What \TeX{} is and what \TeX{} isn't}
  500.  
  501. First of all, let's see what steps are necessary to produce a
  502. document using \TeX\null.  The first step is to type the file
  503. that \TeX{} reads. This is usually called the \TeX{} file or the
  504. input file, and it can be created using a simple text editor (in
  505. fact, if you're using a fancy word processor, you have to be sure
  506. that your file is saved in ASCII or nondocument mode without any
  507. special control characters). The \TeX{} program then reads your
  508. input file and produces what is called a DVI file (DVI stands for
  509. DeVice Independent). This file is not readable, at least not by
  510. humans. The DVI file is then read by another program (called a
  511. device driver) that produces the output that is readable by
  512. humans\TeXref{23}. Why the extra file? The same DVI file can be
  513. read by different device drivers to produce output on a dot
  514. matrix printer, a laser printer, a screen viewer, or a
  515. phototypesetter. Once you have produced a DVI file that gives
  516. the right output on, say, a screen viewer, you can be assured
  517. that you will get exactly the same output on a laser printer
  518. without running the \TeX{} program again.
  519.  
  520. The process may be thought of as proceeding in the following way:
  521. $$
  522. {\hbox{edit text\quad} \atop \longrightarrow}
  523. \lower .6cm \makebox{1.5cm}{1.8cm}%
  524. {\vbox{\hbox{\TeX{}}
  525.        \hbox{input}
  526.        \hbox{file}
  527.        }%
  528. }%
  529. {\hbox{\quad \TeX{} program\quad} \atop \longrightarrow}
  530. \lower .6cm \makebox{1.5cm}{1.8cm}%
  531. {\vbox{\hbox{DVI}
  532.        \hbox{file}}
  533. }%
  534. {\hbox{\quad device driver\quad} \atop \longrightarrow}
  535. \lower .6cm \makebox{1.5cm}{1.8cm}%
  536. {\vbox{\hbox{readable}
  537.        \hbox{output}}
  538. }%
  539. $$
  540.  
  541. This means that we don't see our output in its final form when it
  542. is being typed at the terminal. But in this case a little
  543. patience is amply rewarded, for a large number of symbols not
  544. available in most word processing programs become available. In
  545. addition, the typesetting is done with more precision, and the
  546. input files are easily sent between different computers by
  547. electronic mail or on a magnetic medium.
  548.  
  549. Our focus will be on the first step, that is, creating the \TeX{}
  550. input file and then running the \TeX{} program to produce
  551. appropriate results.  There are two ways of running the \TeX{}
  552. program; it can be run in batch mode or interactively.  In
  553. batch mode you submit your \TeX{} input file to your computer;
  554. it then runs the \TeX{} program without further intervention and
  555. gives you the result when it is finished.  In interactive mode
  556. the program can stop and get further input from the user, that
  557. is, the user can interact with the program.  Using \TeX{}
  558. interactively allows some errors to be corrected by the user,
  559. while the \TeX{} program makes the corrections in batch mode as
  560. best it can. Interactive is the preferred mode, of course. All
  561. personal computer and many mainframe implementations are
  562. interactive.  On some mainframes, however, the only practical
  563. method of running \TeX{} is in batch mode.
  564.  
  565.  
  566. \subsection{From \TeX{} file to readable output, the big set up}
  567. \vskip\baselineskip
  568.  
  569. {\parskip = 0pt \noindent
  570. [Note from MD:
  571. {\sl This is the only system dependent section in the manual and
  572. may be replaced by a local guide. No reference is made to it
  573. outside of the section itself. The following local information
  574. should be included:
  575. \item{$\bullet$} What initial steps, if any, should be taken by the reader
  576. to permit the running of \TeX{} and your local device driver(s).
  577. \item{$\bullet$} How to run \TeX\null.
  578. \item{$\bullet$} How to read the log file.
  579. \item{$\bullet$} How to preview and/or print the dvi file.
  580.  
  581. The following sample is applicable here at the University of
  582. Manitoba.  We use a locally written editor (MANTES) on an
  583. Amdahl running MVS; I'm fairly certain that it's the worst possible case.}]
  584. }
  585.  
  586.  
  587. In this section we'll see how to run \TeX{} at the University of
  588. Manitoba.  It is assumed that the reader is familiar with MANTES
  589. and can create text files using it.
  590.  
  591. First, there are several things that must be done {\bf one time
  592. only}. To start you must do the following (you type in the
  593. material that looks like typewriter type):
  594. \item{(1)} allocate the files that \TeX{} will use by typing the
  595. following lines (while in MANTES):
  596. \itemitem{}  C: {\tt alloc da=source.tex format=vb,256,6144}
  597. \itemitem{}  C: {\tt alloc da=dvi format=fb,1024,6144}
  598.  
  599. \item{(2)} Create a file called RUNTEX in your MANTES aggregate
  600. containing the following JCL:
  601.  
  602. \beginuser
  603. //        JOB  ,'RUN TEX'
  604. //        EXEC TEXC
  605. //SRC     DD DSN=<userid>.SOURCE.TEX,DISP=SHR
  606. //DVI     DD DSN=<userid>.DVI,DISP=OLD
  607. \enduser
  608.  
  609.  
  610. The name {\tt <userid>} is replaced by your own user id, of
  611. course. The use of upper case and the spaces must be followed
  612. exactly.
  613.  
  614. \item{(3)} Create a file called PRINTTEX in your MANTES aggregate
  615. containing the following JCL:
  616.  
  617. \beginuser
  618. //        JOB  ,'PRINT TEX'
  619. //        EXEC TEXP
  620. //DVIFILE DD DSN=<userid>.DVI,DISP=SHR
  621. \enduser
  622.  
  623.  
  624. Once you have completed these three steps, you are ready to run a
  625. \TeX{} job. The files you have created will allow you to produce
  626. about ten pages of ordinary text.
  627.  
  628. Here are the steps you use {\bf each time you run a job}.
  629.  
  630. \item{(1)} create a MANTES file containing your \TeX{} input.
  631. \item{(2)} save and submit your file using the commands
  632. \itemitem{} C: {\tt save f/l to da=source.tex noseq}
  633. \itemitem{} C: {\tt submit runtex}
  634. \item{(3)} when you get a message saying that your job is finished,
  635. enter the command
  636. \itemitem{} C: {\tt out <jobname>; list ttyout}
  637.  
  638. In this command, {\tt <jobname>} is replaced by your user id with
  639. a dollar sign appended.  This file listing will tell you of any
  640. errors that might have occurred.  It is an abbreviated version of
  641. what is called the ``log file''; we will use the term ``log
  642. file'' to refer to the ttyout file produced by \TeX\null.
  643.  
  644. If you want, you can check on the status of your job while it is
  645. executing by using the command
  646. \itemitem{} C: {\tt q <jobname>}
  647.  
  648. When you are finished looking at the log file, the command {\tt
  649. end scratch} will throw away the log file while the command {\tt
  650. end release} will send the log file to the printer, and it can
  651. then be picked up with your \TeX{} output.
  652.  
  653. \item{(4)} when your output from RUNTEX program is error free, \TeX{}
  654. will have created a legal DVI file.  To print it, use the
  655. command
  656. \itemitem{} C: {\tt submit printtex nohold}
  657.  
  658. As in (3), you can check on the status of your job while it is
  659. executing.
  660. \item{(5)} Pick up your output at the I/O window, sixth floor
  661. Engineering building.  It usually takes about twenty minutes for the
  662. output to be ready.  Ask for it by ``{\tt <jobname>}''.
  663.  
  664. The files created are large enough for running \TeX{} jobs of about
  665. 10 pages.  A job of that size will take about one second of CPU time
  666. to run through \TeX\null.  It will take about 15 seconds of CPU time to
  667. print 10 pages on the Xerox 8600 using the current device driver.
  668.  
  669. You can print your own copy of this manual using the command
  670. {\tt \%docu tex}. You can also find lots of other useful
  671. online information about \TeX{} by using {\tt \%texinfo}.
  672.  
  673. \subsection{Let's do it!}
  674.  
  675. So, from our viewpoint, the name of the game is to create the \TeX{}
  676. file that produces the right readable output. What does
  677. a \TeX{} file look like? It consists of characters from an
  678. ordinary terminal, that is, upper and lower case letters,
  679. numbers, and the usual punctuation and accent characters (these
  680. are the usual ASCII characters). Text, for the most part, is just
  681. typed normally. Special instructions usually start with one of a
  682. few special symbols such as {\tt \#} or {\tt \&} (these will be
  683. described in more detail later). Here is an example of a \TeX{}
  684. input file:
  685.  
  686. \beginuser
  687. Here is my first \\TeX\\ sentence.
  688. \\bye
  689. \enduser
  690. \toindex{TeX{} } \toindex{ }
  691.  
  692.  
  693. First note that the characters in this example look like
  694. typewriter type. We use these characters with all examples that
  695. are meant to be typed from the computer terminal. Second, note
  696. that the backslash appears three times in the text. We'll soon
  697. see that this is one of the special symbols mentioned
  698. previously, and it is used very frequently when making \TeX{}
  699. documents. Make a file containing this example. Use the \TeX{}
  700. program to make a DVI file and a device driver to see what you
  701. have produced. If all goes well, you'll have a single page with
  702. the following single sentence:
  703.  
  704. Here is my first \TeX\ sentence.
  705.  
  706.   There will also be a page number at the bottom of the page. If
  707. you've gotten this far, congratulations! Once you can produce one
  708. \TeX{} document, it's just a matter of time before you can do
  709. more complicated ones. Now let's compare what we typed in with
  710. what we got out. The straightforward words were just typed in
  711. normally, and \TeX{} set them in ordinary type. But the word ``\TeX'',
  712. which can't be typed in on a terminal because the letters
  713. aren't on the same line, is entered by using a word starting with
  714. a backslash, and \TeX{} made the proper interpretation. Most
  715. symbols that are not ordinary letters, numbers, or punctuation
  716. are typeset by entering a word starting with a backslash. If we
  717. look a little closer, we'll note that the word ``first'' is also
  718. changed.
  719. \TeXref{4}
  720. The first two letters have been joined together and there isn't
  721. a separate dot over the letter ``i''. This is standard
  722. typesetting practice: certain letter combinations are joined up
  723. to form what are called {\sl ligatures}. There is actually a good
  724. \aesthetic{} reason for this. Compare the first two letters of
  725. ``first'' and ``{f}irst'' to see the difference. We note that
  726. {\tt \\bye} appears in the input file with no corresponding word
  727. in the final copy.
  728. \toindex{bye}
  729. This a typesetting instruction that tells \TeX{} that the input
  730. is finished. We'll learn about lots of different typesetting
  731. instructions as we go along.
  732.  
  733. Let's look at the log file that was created when we ran \TeX
  734. \null. It may vary slightly at your site, but should look
  735. something like this:
  736. \beginuser
  737.    1.
  738.    2.  This is TeX, MVS Version 2.9 (no format preloaded)
  739.    3.   ** File  PLAIN.FMT <-- DD=FMTLIB MEM=PLAIN
  740.    4.
  741.    5.   ** File  SRC.TEX <-- DD=SRC
  742.    6.  (src.tex [1]
  743.    7.  Output written on DVI (1 page, 256 bytes).
  744.    8.  Transcript written on TEXLOG.
  745. \enduser
  746.  
  747.  
  748. This is the file that will contain any error messages. On line 6,
  749. {\tt (src.tex\ } indicated that \TeX{} has started reading that
  750. file. The appearance of {\tt [1]} indicates that page 1 has been
  751. processed. If there were errors on page 1, they would be listed
  752. at that point.
  753.  
  754. \vskip .5cm
  755. \exercise Add a second sentence to your original \TeX{} file to get:
  756. \beginuser
  757. Here is my first \\TeX\\ sentence.
  758. I was the one who typeset it!
  759. \\bye
  760. \enduser
  761.  
  762. Use \TeX{} and look at your output. Is the second sentence on a
  763. new line?
  764.  
  765.  
  766. \exercise Now add this line to the beginning of your file:
  767. \beginuser
  768. \\nopagenumbers
  769. \enduser
  770. \noindent
  771. Guess what will happen when you run the new file through
  772. \TeX\null.  Now try it and see what happens.
  773. \toindex{nopagenumbers}
  774.  
  775. \exercise Add three or four more sentences to your file.
  776. Use letters, numbers, periods, commas, question marks,
  777. and exclamation points, but don't use any other symbols.
  778.  
  779.  
  780. \exercise Leave a blank line and add some more sentences.
  781. You can now get new paragraphs.
  782. \medskip
  783.  
  784. We have now seen a major principle concerning the preparation of
  785. \TeX{} input files. The placement of the text on your computer
  786. terminal does not necessarily correspond to the placement of the
  787. text on your output. You can not, for example, add space between
  788. words in your output by adding spaces in your input file. Several
  789. consecutive spaces and one space will produce exactly the same
  790. output. As would be expected, a word at the end of one line will
  791. be separated from the first word of the following line. In fact,
  792. sometimes when working on a file that will be heavily edited, it
  793. is convenient to start each sentence on a separate line. Spaces
  794. at the beginning of a line, however, are always ignored.
  795.  
  796. \exercise Add the following sentence as a new paragraph, and then
  797. typeset it:
  798. \beginuser
  799. Congratulations! You received a grade of 100\% on your latest
  800. examination.
  801. \enduser
  802. \noindent
  803. The {\tt\%} sign is used for comments in your input file.
  804. Everything on a line following this symbol is ignored. Notice
  805. that even the space that normally separates the last word on one
  806. line from the first word on the next line is lost. Now put a
  807. backslash in front of the {\tt\%} sign to correct the
  808. sentence. \toindex{\$} \toindex{\%}
  809.  
  810. \exercise Add the following sentence as a new paragraph:
  811. \beginuser
  812. You owe me \$10.00 and it's about time you sent it to me!
  813. \enduser
  814. \noindent
  815. This will produce an error in your log file (if your
  816. implementation of \TeX{} is interactive, that is, sends you
  817. messages and waits for answers, just hit the carriage return or
  818. enter key when you get the error message). You will get output,
  819. but not what you might expect. Look at the log file and see
  820. where the error messages are listed. Don't worry about the
  821. actual messages. We'll have a lot more to say about errors
  822. (including this one) later. Now fix the error by putting a
  823. backslash in front of the {\tt \$} sign, and typeset the result
  824. (there are a small number of characters like the per cent and
  825. dollar signs that \TeX{} uses for its own purposes. A table of
  826. these characters will be provided shortly).
  827.  
  828. \subsection{\TeX{} has everything under control}
  829.  
  830. We have seen that the backslash has a special role. Any word
  831. starting with a backslash will be given a special interpretation
  832. when \TeX{} reads it from your input file. Such a word is called
  833. a {\sl control sequence}. There are, in fact, two types of
  834. control sequences: a {\sl control word\/} is a backslash followed
  835. by letters only (for example, {\tt \\TeX}) and a {\sl control
  836. symbol\/} is a backslash followed by a single nonletter (for
  837. example, {\tt \\\$})\null. Since a space is a nonletter, a
  838. backslash followed by a space is a legitimate control symbol.
  839. \TeXref{7--8}
  840. When we want to emphasize that a space is present, we will use a
  841. special symbol {\tt\sp} to indicate the space, as in the control
  842. symbol {\tt\\\sp}.  This convention is used in {\bf The \TeX
  843. book} as well as in this manual.
  844.  
  845. When \TeX{} is reading your input file and comes to a backslash
  846. followed by a letter, it knows that a control word is being
  847. read. So it continues reading the name of the control word until
  848. a nonletter is read. So if your file contains
  849.  
  850. \displaytext{\tt I like \\TeX!}
  851.  
  852. \noindent
  853. the control word {\tt \\TeX} is terminated by the exclamation
  854. point. But this presents a problem if you want to have a space
  855. after a control word. If you have, for example, the sentence
  856.  
  857. \displaytext{\tt I like \\TeX and use it all the time.}
  858.  
  859. \noindent
  860. in your input file, the control word {\tt\\TeX} is terminated by
  861. the space (which is, of course, a nonletter). But then you won't
  862. have a space between the words ``\TeX{}'' and ``and''; inserting
  863. more spaces won't help, since \TeX{} doesn't distinguish between
  864. one space and several consecutive spaces. But if you put the
  865. control symbol {\tt\\\sp} after a control word, you will both
  866. terminate the control word and insert a space. It's really easy
  867. to forget to put in something like {\tt\\\sp} after a control
  868. word. I promise you that you will do it at least once while
  869. you're learning to use \TeX\null.
  870.  
  871. \exercise Make an input file that will produce the following
  872. paragraph:
  873.  
  874. I like \TeX! Once you get the hang of it, \TeX{} is really easy
  875. to use. You just have to master the \TeX nical aspects.
  876.  
  877. Most control words are named so as to give a hint of their uses.
  878. You can use {\tt \\par} to make a new paragraph, for example,
  879. instead of putting in a blank line.
  880. \toindex{par}
  881.  
  882. \subsection{What \TeX{} won't do}
  883.  
  884. \TeX{} is very good at setting type, but there are things that \TeX{}
  885. can't do well.  One is making figures.  Space can be left
  886. to insert figures, but there are no graphic procedures built into
  887. the language (at present).  Some implementations allow graphic
  888. instructions to be inserted using the {\tt \\special} control
  889. word but these are exceptional and definitely site dependent.
  890.  
  891. \TeX{} sets type in horizontal straight lines and not in
  892. straight lines at other angles. In particular, it is generally
  893. not possible to make insertions in ``landscape mode'', that is,
  894. with the text rotated by so that the baseline is parallel with
  895. the long edge of the paper, or to include text that has a curve for
  896. a baseline. Perspective type (gradually increasing or
  897. decreasing in height) is not handled well by \TeX\null.
  898.  
  899. We have seen that there is an ``edit, \TeX{}, driver'' cycle that
  900. is necessary for each different copy of output.  This is true
  901. even when the output device is a terminal.  In particular, it's
  902. not possible to type the input file and see the results on the
  903. screen immediately without going through the full cycle.  Some
  904. implementations have both text and graphics displays with
  905. reasonably quick turnaround (a few seconds for a single page); as
  906. hardware becomes less expensive and processors become faster, we
  907. may see improvement.
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914. \section{All characters great and small}
  915.  
  916. \subsection{Some characters are more special than others}
  917.  
  918. We saw in the last section that most text is entered at the
  919. terminal as sentences of ordinary words just as when typing with
  920. a typewriter. But we also saw that, in particular, the backslash
  921. could be used for at least two different purposes. It can be
  922. used for symbols (or combinations of symbols) that don't appear
  923. on the keyboard such as typing {\tt \\TeX} to get \TeX\null. It
  924. can also be used to give \TeX{} special instructions such as
  925. typing {\tt \\bye} to indicate the end of the input file. In
  926. general, a word starting with a backslash will be interpreted by
  927. \TeX{} as one requiring special attention. There are several
  928. hundred words that \TeX{} knows, and you can define more
  929. yourself, and so the backslash is very important. We'll spend a
  930. lot of time as we proceed learning some of these words;
  931. fortunately we'll only need to use a small number of them most of
  932. the time.
  933.  
  934. There are ten characters which, like the backslash, are used
  935. by \TeX{} for special purposes, and we now want to give the
  936. complete list.
  937. \TeXref{37--38}What if we want to use a sentence with one of these
  938. special characters in it? With this in mind we'll ask the following
  939. questions:
  940. \item{(1)} What are the different special characters?
  941. \item{(2)} How do we use a special character if we really want to
  942. typeset it in our text?
  943.  
  944. Here is a table of each special character, its purpose, and the
  945. method of typesetting the special character itself if you need
  946. it:
  947.  
  948.  
  949. \maketable [Characters requiring special input]
  950. \halign{
  951.    \strut \hfil#\hfil & \quad # \hfil & \quad\tt # \hfil\cr
  952.    \bf Character & \bf Purpose & \bf Input for literal output \cr
  953.    \noalign{\hrule} \noalign{\smallskip}
  954.    $\backslash$   & Special symbols and instructions & \$\\backslash\$   \cr
  955.    $\{$ & Open group                       & \$\\\lb\$    \cr
  956.    $\}$ & Close group                      & \$\\\rb\$    \cr
  957.    \%   & Comments                         & \\\%         \cr
  958.    \&   & Tabs and table alignments        & \\\&         \cr
  959.    \~{} & Unbreakable space                & \\\~{}\lb\rb \cr
  960.    \$   & Starting or ending math text     & \\\$         \cr
  961.    \^{} & Math superscripts                & \\\^{}\lb\rb \cr
  962.    \_{} & Math subscripts                  & \\\_{}\lb\rb \cr
  963.    \#   & Defining replacement symbols     & \\\#         \cr
  964.        }
  965.  
  966. \toindex{\lb}
  967. \toindex{\rb}
  968. \toindex{\%}
  969. \toindex{\&}
  970. \toindex{\~{}}
  971. \toindex{\$}
  972. \toindex{\^{}}
  973. \toindex{\_{}}
  974. \toindex{\#}
  975.  
  976. \subsection{Typesetting with an accent}
  977.  
  978. Now we're going to start using some of \TeX{}'s goodies! So far
  979. we've just been using \TeX{} to make our output look attractive,
  980. but now we'll start to do things that are difficult or impossible
  981. on the typewriter. In particular, we're going to look at accents
  982. now. How do you produce an accent when the symbol doesn't appear on
  983. the keyboard? Just as with the symbol \TeX{}, it is necessary to
  984. enter a word starting with a backslash. For the word ``premi\`ere'',
  985. as a first example, you need to type in {\tt premi\\`ere}
  986. (you may have to hunt around to find the ``back prime''
  987. or ``grave'' symbol {\tt `} on your keyboard, but it's there
  988. somewhere\fnote{If you have a very old or obscure
  989. keyboard and the back prime is {\it really\/} not there, you can
  990. use {\tt \\lq\lb\rb} instead.  Similarly {\tt \\rq\lb\rb} can be
  991. used for the symbol {\tt '}. You can think of the symbols as
  992. being abbreviations for ``left quote'' and ``right quote.'' In
  993. addition, {\tt \\lq\\lq\lb\rb} and {\tt \\rq\\rq\lb\rb} give the
  994. usual quotation marks. But this won't work as a method to produce
  995. an accent over the following letter, so you're really better off
  996. with a proper keyboard.}). In general, to put an accent
  997. on a letter, the appropriate control sequence precedes the letter.
  998.  
  999. Here are some examples:
  1000. $$\vbox{
  1001.  
  1002. \halign{
  1003. \strut \hfil\tt # & \quad # \hfil\cr
  1004. \bf \TeX{} input & \bf \TeX{} output \cr
  1005. \noalign{\hrule} \noalign{\smallskip}
  1006. \\`a la mode          & \`a la mode \cr
  1007. r\\'esum\\'e          & r\'esum\'e  \cr
  1008. soup\\c{\sp}con   & soup\c con  \cr
  1009. No\\"el               & No\"el      \cr
  1010. na\\"\\i{\sp}ve    & na\"\i ve   \cr
  1011. }
  1012. }$$
  1013.  
  1014.  
  1015. We see several principles illustrated by these examples. Most
  1016. accents are produced by using a control symbol with a similar
  1017. shape. A few of them are produced by control words containing a
  1018. single letter. Some care must be used in this case, for a space
  1019. must be used to terminate the control word. If you have {\tt
  1020. soup\\ccon} in your file, for example, \TeX{} will look for the
  1021. control word {\tt\\ccon}\fnote{We'll see that there is another
  1022. method when we look at the grouping concept in Section~4.}.
  1023. \TeXref{52--53}
  1024.  
  1025. Notice that there is a control word {\tt\\i} also. This produces
  1026. the letter ``i'' without the dot over it; this allows an accent
  1027. to be put over the lower part of the letter. There is an
  1028. analogous control word {\tt\\j} that produces a dotless ``j''
  1029. for accenting purposes.
  1030.  
  1031. \maketable [Accents that may be immediately followed by a letter]
  1032. \halign{
  1033.    \strut \hfil # & \quad \hfil \tt # \hfil & \hfil \quad # \hfil\cr
  1034.    \bf Name & \bf \TeX{} input & \bf \TeX{} output \cr
  1035.    \noalign{\hrule} \noalign{\smallskip}
  1036.    grave           & \\`o & \`o \cr
  1037.    acute           & \\'o & \'o \cr
  1038.    circumflex      & \\\^{}o & \^o \cr
  1039.    umlaut/dieresis/tr\'emat & \\"{}o    & \"o \cr
  1040.    tilde           & \\\~{}o & \~o \cr
  1041.    macron          & \\={}o    & \=o \cr
  1042.    dot             & \\\char'056{}o    & \.o \cr
  1043.        }
  1044.  
  1045. \toindex{`}
  1046. \toindex{'}
  1047. \toindex{\^{}}
  1048. \toindex{"}
  1049. \toindex{i}
  1050. \toindex{j}
  1051. \toindex{=}
  1052. \toindex{.}
  1053.  
  1054. \maketable [Accents requiring an intervening space]
  1055. \halign{
  1056.    \strut \hfil # \hfil & \quad \hfil \tt # \hfil & \hfil \quad # \hfil\cr
  1057.    \bf Name & \bf \TeX{} input & \bf \TeX{} output \cr
  1058.    \noalign{\hrule} \noalign{\smallskip}
  1059.    cedilla         & \\c o   & \c{o} \cr
  1060.    underdot        & \\d o   & \d{o} \cr
  1061.    underbar        & \\b o   & \b{o} \cr
  1062.    h\'a\v{c}ek     & \\v o   & \v{o} \cr
  1063.    breve           & \\u o   & \u{o} \cr
  1064.    tie             & \\t oo  & \t oo \cr
  1065.    Hungarian umlaut& \\H o   & \H{o} \cr
  1066.       }
  1067.  
  1068. \toindex{c}
  1069. \toindex{d}
  1070. \toindex{b}
  1071. \toindex{v}
  1072. \toindex{u}
  1073. \toindex{t}
  1074. \toindex{H}
  1075.  
  1076. \TeX{} also allows some letters from languages other than English to
  1077. be typeset.
  1078.  
  1079. \maketable [A\kern-1pt vailable foreign language symbols]
  1080. \halign{
  1081.    \strut \hfil # \hfil & \quad \hfil \tt # \hfil & \hfil \quad # \hfil\cr
  1082.    \bf Example& \bf \TeX{} input & \bf \TeX{} output \cr
  1083.    \noalign{\hrule} \noalign{\smallskip}
  1084.    \AE gean, \ae sthetics     & \\AE, \\ae    & \AE, \ae \cr
  1085.    \OE uvres, hors d'\oe uvre & \\OE \\oe     & \OE, \oe \cr
  1086.    \AA ngstrom                & \\AA, \\aa    & \AA, \aa \cr
  1087.    \O re, K\o benhavn         & \\O, \\o      & \O, \o   \cr
  1088.    \L odz, \l\'odka           & \\L, \\l      & \L, \l   \cr
  1089.    Nu\ss                      & \\ss          & \ss      \cr
  1090.    ?`Si?                      & {?}{`}        & ?`       \cr
  1091.    !`Si!                      & {!}{`}        & !`       \cr
  1092.    Se\~nor                    & \\\~{}        & \~{}       \cr
  1093.                              & \lb\\it\\\$\rb & {\it\$}  \cr
  1094.       }
  1095.  
  1096. \toindex{AE}
  1097. \toindex{ae}
  1098. \toindex{OE}
  1099. \toindex{oe}
  1100. \toindex{AA}
  1101. \toindex{aa}
  1102. \toindex{O}
  1103. \toindex{o}
  1104. \toindex{L}
  1105. \toindex{l}
  1106. \toindex{ss}
  1107.  
  1108. Typeset the sentence in each of the following exercises:
  1109.  
  1110. \exercise Does \AE schylus understand \OE dipus?
  1111.  
  1112. \exercise The smallest internal unit of \TeX{} is about 53.63\AA.
  1113.  
  1114. \exercise They took some honey and plenty of money wrapped up in a
  1115. {\it \$}5 note.
  1116.  
  1117. \exercise \'El\`eves, refusez vos le\c cons! Jetez vos cha\^\i nes!
  1118.  
  1119. \exercise Za\v sto tako polako pijete \v caj?
  1120.  
  1121. \exercise Mein Tee ist hei\ss.
  1122.  
  1123. \exercise Peut-\^etre qu'il pr\'ef\`ere le caf\'e glac\'e.
  1124.  
  1125. \exercise ?`Por qu\'e no bebes vino blanco? !`Porque est\'a avinagrado!
  1126.  
  1127. \exercise M\'\i\'\j n idee\"en worden niet be\"\i nvloed.
  1128.  
  1129. \exercise Can you take a ferry from \"Oland to \AA land?
  1130.  
  1131. \exercise T\"urk\c ce konu\c san ye\u genler nasillar?
  1132.  
  1133.  
  1134. \def\bdots{$\textfont0=\tenbf \ldots$} %%% boldface version of \ldots
  1135.  
  1136. \subsection{Dots, dashes, quotes, \bdots}
  1137.  
  1138. Typing has always been a compromise: the small number of keys
  1139. (compared to the number of typeset symbols available) has forced
  1140. some changes on the typist.  When preparing material using \TeX{},
  1141. there is no need to be so restricted. In this section we'll look
  1142. at some differences between typing and using \TeX\null.
  1143.  
  1144. There are four types of dashes that are used.  The hyphen is used
  1145. for combining words into one unit as with mother-in-law.
  1146. \TeXref{3--5}
  1147. The en-dash is used to indicate a sequence of page numbers, years
  1148. or such things. The em-dash is a grammatical symbol.  The minus
  1149. sign is used for negative numbers. Here they are with their uses:
  1150.  
  1151. \maketable [Different types of dashes]
  1152. \halign{
  1153.    \strut \hfil # \hfil & \quad \hfil \tt # \hfil & \hfil \quad # \hfil
  1154.                         & \hfil # \hfil\cr
  1155.    \bf Name& \bf \TeX{} input & \bf \TeX{} output & \bf Example\cr
  1156.    \noalign{\hrule} \noalign{\smallskip}
  1157.    hyphen     & -         & -   & The space is 3-dimensional. \cr
  1158.    en-dash    & {-}{-}    & --  & Read pages 3--4. \cr
  1159.    em-dash    & {-}{-}{-} & --- & I saw them---there were 3 men alive. \cr
  1160.    minus sign & \$-\$     & $-$ & The temperature dropped to $-$3 degrees. \cr
  1161.       }
  1162.  
  1163. \exercise I entered the room and---horrors---I saw both my
  1164. father-in-law and my mother-in-law.
  1165.  
  1166. \exercise The winter of 1484--1485 was one of discontent.
  1167. \bigskip
  1168.  
  1169.  
  1170. Another difference between typing and using \TeX{} is the use of
  1171. quotation marks.  Opening and closing quotation marks are the
  1172. same on a typewriter.  They are produced in \TeX{} by using the
  1173. apostrophe or prime key {\tt '} and backprime key {\tt `}\null.
  1174. An open quote is produced by {\tt ``} and the
  1175. close quote by {\tt ''}\null.\TeXref{3} Similarly the
  1176. opening single quote is produced by {\tt `} and the closing
  1177. single quote by {\tt '}\null. Notice that there is no need
  1178. to use the usual typing quotation mark (it normally gives a close
  1179. quote, but don't count on it).
  1180.  
  1181. \exercise His ``thoughtfulness'' was impressive.
  1182.  
  1183. \exercise Frank wondered, ``Is this a girl that can't say `No!'?''
  1184. \bigskip
  1185.  
  1186. Sometimes ellipses (three dots) are used to indicate a passage
  1187. of time or missing material.  Typing three periods will give
  1188. three dots very close together. The dots with proper spacing will
  1189. be produced by having {\tt \\dots} in your input file.
  1190. \TeXref{173}
  1191. \toindex{dots}
  1192.  
  1193. \exercise He thought, ``\dots and this goes on forever, perhaps to the
  1194. last recorded syllable.''
  1195.  
  1196. Another problem with dots is that the period after an
  1197. abbreviation normally has less space after it than does the
  1198. period at the end of a sentence. There are two ways to solve this
  1199. problem: the dot can be followed by either {\tt\\\sp} or {\tt\~{}}
  1200. to change the spacing.
  1201. \TeXref{91--92}
  1202. The second alternative will give an unbreakable space; when such
  1203. a space is between two words, these words must typeset on the
  1204. same line. The input {\tt Prof.\~{}Knuth} would cause those two
  1205. words to be typeset on one line.  This is desirable for names
  1206. like Vancouver, B.~C. and Mr.~Jones so that ``Mr.'' and ``Jones''
  1207. do not end up on separate lines. Notice that no backslash is used
  1208. with the unbreakable space.
  1209.  
  1210. \exercise Have you seen Ms.~Jones?
  1211.  
  1212. \exercise Prof.~Smith and Dr.~Gold flew from
  1213. \ifcanspell
  1214. Halifax N.~S. to Montr\'eal, P.~Q. via Moncton, N.~B.
  1215. \else
  1216. L.~A. to Washington, D.~C., via Fargo, N.~D.
  1217. \fi
  1218.  
  1219.  
  1220. \subsection{Different fonts}
  1221.  
  1222. The most obvious difference between typewritten text and \TeX{}
  1223. output is undoubtedly the different fonts or types of symbols
  1224. used. When \TeX{} starts up it has sixteen fonts available.  Some
  1225. of these are used for technical purposes, but even so there are
  1226. several different typefaces available as can be seen in the
  1227. following table. A complete list of the sixteen fonts is given in
  1228. Appendix F of {\bf The \TeX{}book}.
  1229. \TeXref{427--432}
  1230. Most of them are used automatically; a mathematical subscript,
  1231. for example, is put in smaller type by \TeX{} with no special
  1232. user intervention.
  1233.  
  1234. To change from the usual (roman) typeface to italic, the control
  1235. word {\tt \\it} is used.  To change back to the usual roman
  1236. typeface, use {\tt \\rm}. For example, you could have the
  1237. following sentence: {\tt I started with roman type, \\it switched
  1238. to italic type, \\rm and returned to roman type}. This would give
  1239. the following: I started with roman type, \it switched to italic
  1240. type,\fnote{Notice that the comma and this footnote are in
  1241. italic type, and this looks a little funny. We'll see that there
  1242. is another method for changing fonts when we talk about grouping
  1243. in Section 4.}
  1244. \rm and returned to roman type.
  1245.  
  1246. Typefaces other than italic are also available. Those given below
  1247. are the ones most commonly used.  They are available immediately
  1248. when \TeX{} starts. A little later we'll see how to use other
  1249. typefaces that aren't available when \TeX{} starts.
  1250.  
  1251. \global\advance\footnotenum by 1
  1252. \maketable [Font Samples]
  1253. \halign{
  1254.    \strut \hfil # \hfil & \quad \hfil \tt # \hfil & \hfil \quad # \hfil\cr
  1255.    \bf Font name & \bf \TeX{} switch sequence & \bf Sample of typeface \cr
  1256.    \noalign{\hrule} \noalign{\smallskip}
  1257.    Roman       & \\rm  & \rm This is roman type. \cr
  1258.    Boldface    & \\bf  & \bf This is boldface type. \cr
  1259.    Italic      & \\it  & \it This is italic type. \cr
  1260.    Slanted     & \\sl  & \sl This is slanted type. \cr
  1261.    Typewriter  & \\tt  & \tt This is typewriter type. \cr
  1262.    Math symbol${}^\the\footnotenum$ & \\cal & $\cal SOME\hbox{\quad}SCRIPT
  1263.                                      \hbox{\quad}LETTERS$\rm. \cr
  1264.       }
  1265.  
  1266. \footnote{}{\llap{$^\the\footnotenum$}%
  1267. This example is cheating since you need to know a little about
  1268. mathematics input to use it, but I wanted to include it anyway.
  1269. You'll be able to use these letters after you study the use of
  1270. mathematical symbols.}
  1271. \nobreak
  1272. \toindex{it}
  1273. \toindex{rm}
  1274. \toindex{bf}
  1275. \toindex{sl}
  1276. \toindex{tt}
  1277.  
  1278. The slanted and italic fonts seem quite similar at first.  It is
  1279. easy to see the difference between the letter ``a'' in each
  1280. sample. When changing from a slanted or italic font to a roman
  1281. font, the last letter in the first font will lean towards the
  1282. first letter of the roman font; this looks cramped, and to
  1283. compensate there is a little extra space that can be added called
  1284. the {\sl italic correction}. This is done using the control
  1285. symbol {\tt \\/}.
  1286. \toindex{/}
  1287. In the following sentence, there is no italic correction after
  1288. the first sequence of italic letters but there is after the
  1289. second sequence; see the difference: {\it If} the italic
  1290. correction is not used the letters are too close together, but
  1291. {\it if\/} the correction is used, the spacing is better.  There
  1292. is no need for the italic correction when the italic characters
  1293. are followed by a comma or a period, but your text will
  1294. definitely look better if you use it before quotation marks or
  1295. parentheses.
  1296.  
  1297.  
  1298. It is possible to use fonts other than those initially defined in
  1299. \TeX{} when desired (assuming that they are available on
  1300. your computer system, of course).  Different sizes can be used
  1301. with the aid of the control word {\tt \\magstep}. To define your
  1302. new font you will have to know its name on your computer system.
  1303. For example, the roman typeface is called ``cmr10'' on most
  1304. systems.  If you use {\tt \\font\\bigrm = cmr10 scaled \\magstep
  1305. 1}, you can then use {\tt\\bigrm} in exactly the same way as you
  1306. use {\tt\\it} or {\tt\\rm}.
  1307. \TeXref{13--17}
  1308. \toindex{magstep}
  1309. \toindex{font}
  1310. \toindex{scaled}
  1311.  
  1312. Switching via {\tt\\bigrm} will give roman type that is larger
  1313. than the usual by 20\%\null.  {\tt \\font\\bigbigrm = cmr10
  1314. scaled \\magstep 2} will define a font that is about 44\% larger
  1315. than the usual roman typeface.  The sizes {\tt \\magstep~0} to
  1316. {\tt \\magstep~5} are available.  On most computers {\tt \\magstephalf}
  1317. is also available; this represents an enlargement of
  1318. about 9.5\%\null. Here are some samples at various sizes:
  1319.  
  1320. \maketable [Different Font Magnifications]
  1321. \halign{
  1322.    \strut \tt # \hfil & \quad # \hfil \cr
  1323.    \bf Magnification & \bf Sample \cr
  1324.    \noalign{\hrule} \noalign{\smallskip}
  1325.    \\magstep 0     & \rm  Sample text at magstep 0. \cr
  1326.    \\magstephalf   & \halfrm  Sample text at magstephalf. \cr
  1327.    \\magstep 1     & \brm  Sample text at magstep 1. \cr
  1328.    \\magstep 2     & \bbrm  Sample text at magstep 2. \cr
  1329.    \\magstep 3     & \bbbrm  Sample text at magstep 3. \cr
  1330.    \\magstep 4     & \bbbbrm  Sample text at magstep 4. \cr
  1331.    \\magstep 5     & \bbbbbrm  Sample text at magstep 5. \cr
  1332.       }
  1333. \bigskip
  1334.  
  1335. It's also possible to use completely new typefaces.  These
  1336. are dependent on system availability, of course.  Many systems
  1337. have a file called CMSS10 which is a font that contains sans
  1338. serif letters.  Using {\tt \\font\\sf = cmss10} will allow the
  1339. control word {\tt\\sf} to be used in the same manner as {\tt\\bf}.
  1340. Having made this definition, the input
  1341. \displaytext{\tt \\sf Here is a sample of our new Sans Serif font.}
  1342. will produce
  1343. \displaytext{\sf Here is a sample of our new Sans Serif font.}
  1344.  
  1345. \exercise What problem might have arisen if we had used {\tt \\ss}
  1346. instead of {\tt \\sf} to turn on the Sans Serif font? Hint: if
  1347. the answer doesn't occur to you at first, think about the German
  1348. alphabet and it will finally come to you.
  1349.  
  1350. \exercise Typeset a paragraph of magnified sans serif text.
  1351.  
  1352. The extra fonts available may vary from site to site.  The ones
  1353. in the following table are available at most places.
  1354.  
  1355. \maketable [External Fonts Names]
  1356. \halign{
  1357. \strut \tt # \hfil & \quad \tt # \hfil & \quad \tt # \hfil
  1358.                    & \quad \tt # \hfil & \quad \tt # \hfil
  1359.                    & \quad \tt # \hfil  \cr
  1360. \noalign{\hrule} \noalign{\smallskip}
  1361. CMBSY10   &CMBXSL10  &CMBXTI10  &CMBX10    &CMBX12    &CMBX5      \cr
  1362. CMBX6     &CMBX7     &CMBX8     &CMBX9     &CMB10     &CMCSC10    \cr
  1363. CMDUNH10  &CMEX10    &CMFF10    &CMFIB8    &CMFI10    &CMITT10    \cr
  1364. CMMIB10   &CMMI10    &CMMI12    &CMMI5     &CMMI6     &CMMI7      \cr
  1365. CMMI8     &CMMI9     &CMR10     &CMR12     &CMR17     &CMR5       \cr
  1366. CMR6      &CMR7      &CMR8      &CMR9      &CMSLTT10  &CMSL10     \cr
  1367. CMSL12    &CMSL8     &CMSL9     &CMSSBX10  &CMSSDC10  &CMSSI10    \cr
  1368. CMSSI12   &CMSSI17   &CMSSI8    &CMSSI9    &CMSSQI8   &CMSSQ8     \cr
  1369. CMSS10    &CMSS12    &CMSS17    &CMSS8     &CMSS9     &CMSY10     \cr
  1370. CMSY5     &CMSY6     &CMSY7     &CMSY8     &CMSY9     &CMTCSC10   \cr
  1371. CMTEX10   &CMTEX8    &CMTEX9    &CMTI10    &CMTI12    &CMTI7      \cr
  1372. CMTI8     &CMTI9     &CMTT10    &CMTT12    &CMTT8     &CMTT9      \cr
  1373. CMU10     &CMVTT10                                                \cr
  1374. }
  1375. \bigskip
  1376.  
  1377. Here's a little background about these names.  The first two
  1378. letters {\tt CM} stands for Computer Modern, the name given to
  1379. this font family by the designer. The number at the end is the
  1380. point size: 10 point type is the normal size, 7 point is the
  1381. normal size for subscripts, and 5 point is the normal size for
  1382. subscripts of subscripts, 12 point is 20\% larger than 10 point,
  1383. etc. If the letters {\tt CM} are followed by {\tt B}, it is a
  1384. boldface type.  Similarly {\tt R} indicates roman, {\tt I} is for
  1385. italics, {\tt CSC} is for small caps, {\tt SL} is for slanted,
  1386. {\tt SS} is for sans serif, {\tt SY} is for symbols,
  1387. and {\tt TT} is for typewriter type.
  1388.  
  1389. \exercise Find the fonts available on your system, and print out
  1390. all the letters and numbers in several of them.
  1391.  
  1392. \exercise The font {\tt CMR12} is 20\% larger than {\tt CMR10}.
  1393. Also {\tt \\magstep~1} magnifies the type by 20\%.  Take some
  1394. text and print it using {\tt CMR12} then using {\tt CMR10} scaled
  1395. by {\tt \\magstep~1}. The results are quite different!
  1396.  
  1397.  
  1398.  
  1399.  
  1400. \section{The shape of things to come}
  1401.  
  1402. In this section we want to see how to make text have different
  1403. shapes or sizes.  One may use \TeX{} with the default sizes, of
  1404. course, just as we have been doing so far.  We'll now become more
  1405. creative with our output.  In discussing the size of various
  1406. parts of a page of text, there are several units of measure we
  1407. can use.
  1408.  
  1409. \subsection{Units, units, units}
  1410.  
  1411. \TeX{} can measure length using many types of units.  The most
  1412. common are the inch, the \centimeter, the point, the pica. The
  1413. abbreviations for these units are {\tt in}, {\tt cm}, {\tt pt},
  1414. and {\tt pc} respectively. The point is defined by the equation 1
  1415. inch = 72.27 points, and the pica by 1 pica = 12 points. Thus a
  1416. point is rather small and is about the size of a decimal point.
  1417. Here is a sample to give an idea of the comparative sizes:
  1418. \def\pip{\vrule height 4 true pt }
  1419. \TeXref{57}
  1420.  
  1421. $$ \hbox{1 inch: } \hbox to 1 true in{\pip\hrulefill\pip}$$
  1422. $$ \hbox{1 \centimeter: }\hbox to 1 true cm{\pip\hrulefill\pip}$$
  1423. $$ \hbox{20 points: }\hbox to 20 true pt{\pip\hrulefill\pip}$$
  1424. $$ \hbox{1 pica: } \hbox to 1 true pc{\pip\hrulefill\pip}$$
  1425.  
  1426. Thus points are used to make fine changes; a pica is about the
  1427. distance between the baselines of two consecutive lines of
  1428. (unmagnified) normal text.  \TeX{} is quite exact about
  1429. dimensions; internally its smallest unit is less than one
  1430. four-millionth of an inch.  Hence it is the resolution of the
  1431. output device that will determine the accuracy of the output.
  1432.  
  1433. There are two other units that are sometimes useful that have
  1434. different sizes in different fonts. The {\tt ex} is about the
  1435. height of a small ``x'' and the {\tt em} is a little smaller than
  1436. the width of a capital ``M''\null.
  1437. \TeXref{60}
  1438.  
  1439. The shape of the output is generally determined by control
  1440. words. There are many such words; these allow very fine control
  1441. of the resulting text.  But most of the time only a small number
  1442. of them are necessary.
  1443.  
  1444. \subsection{Page shape}
  1445.  
  1446. The text on a page consists of three basic parts.  There is the
  1447. headline above the main text; this often contains a chapter
  1448. title, section title, or a page number, and may differ on odd and
  1449. even pages. Below this is the main text, which includes any
  1450. footnotes. And finally there is the footline that might contain a
  1451. page number.
  1452.  
  1453. In the examples we have seen so far, the headline has been blank.
  1454. The footline has contained either a \centred{} number or, if {\tt
  1455. \\nopagenumbers} had been used, has also been blank.  We'll have
  1456. more to say about headlines and footlines later in this section.
  1457. For the moment let's concentrate on the main text.
  1458.  
  1459. To finish one page and start a new one, {\tt \\vfill \\eject} can
  1460. be used.  The control word {\tt \\eject} forces the completion of
  1461. the current page, while {\tt \\vfill} causes any left over
  1462. vertical space to be gathered at the bottom of the page (you might
  1463. try leaving out the {\tt \\vfill} as an experiment to see how the
  1464. vertical \analog{} of justified horizontal lines of text works).
  1465. \toindex{vfill}
  1466. \toindex{eject}
  1467.  
  1468.  
  1469. {\hsize=4in
  1470. The current horizontal width of the text on the page is described
  1471. by the control word {\tt \\hsize}.  It can be changed, say to 4
  1472. inches, by {\tt \\hsize = 4 in\ } at any desired time using
  1473. methods to be described in the next few sections. The value of
  1474. {\tt \\hsize} in effect when the paragraph is completed
  1475. determines the width of the paragraph. As can be seen in this
  1476. paragraph, the text width can be changed (in this case to 4
  1477. inches) for a single paragraph.  Because it represents the
  1478. current value of the horizontal width, expressions such as {\tt
  1479.  \\hsize = 0.75\\hsize} can make a new value that is relative
  1480. to the old one. \par}
  1481. \toindex{hsize}
  1482.  
  1483. The vertical \analog{} of {\tt \\hsize} is {\tt \\vsize}, which
  1484. is the current height of the main text.  It can be reset, just
  1485. like {\tt \\hsize}.  Thus, {\tt \\vsize = 8 in\ } can be used to
  1486. change the vertical height of the main text. Note that {\tt \\vsize}
  1487. is the size of the text exclusive of any headline or
  1488. footline material.
  1489. \toindex{vsize}
  1490.  
  1491. Text can also be shifted across the page.  The upper left corner
  1492. of the text is one inch down and one inch in from the upper left
  1493. corner of the page.  The control words {\tt \\hoffset} and {\tt \\voffset}
  1494. are used to shift the text horizontally and
  1495. vertically.  Thus {\tt \\hoffset = .75 in} and {\tt \\voffset =
  1496. -.5 in} would shift the text an additional .75 inches to the
  1497. right and .5 inches up. Most of the time you'll need to set {\tt
  1498. \\hoffset}, {\tt \\voffset}, and {\tt \\vsize} at the beginning
  1499. of your document only.
  1500. \TeXref{251}
  1501. \toindex{hoffset}
  1502. \toindex{voffset}
  1503.  
  1504. \global\advance\footnotenum by 1
  1505. \maketable [Control words for page sizes]
  1506. \halign{
  1507.    \strut \hfil # & \quad \hfil \tt # \hfil & \hfil \quad # \hfil\cr
  1508.    \bf Name & \bf \TeX{} Control Word & \bf \TeX{} default value (inches)\cr
  1509.    \noalign{\hrule} \noalign{\smallskip}
  1510.    horizontal width  & \\hsize   & 6.5 \cr
  1511.    vertical width    & \\vsize   & 8.9 \cr
  1512.    horizontal offset${}^\the\footnotenum$  & \\hoffset & 0 \cr
  1513.    vertical offset${}^\the\footnotenum$   & \\voffset & 0 \cr
  1514.       }
  1515.  
  1516. \footnote{}{\llap{$^\the\footnotenum$}The text is initially 1 inch
  1517. down and 1 inch in from upper left corner of the page.}
  1518. \nobreak
  1519.  
  1520. \exercise Enter a paragraph of text that is a few lines long.
  1521. Take several copies of your paragraph and put {\tt \\hsize = 5
  1522. in\ } before one and {\tt \\hsize = 10 cm\ } in front of a second
  1523. one.  Try a few other values for {\tt \\hsize}.
  1524.  
  1525. \exercise Put {\tt \\hoffset = .5 in\ } and {\tt \\voffset = 1
  1526. in\ } before the first paragraph of your previous exercise.
  1527.  
  1528. \exercise Take your previous exercise and put {\tt \\vsize = 2
  1529. in\ } before the first paragraph.
  1530. \bigskip
  1531.  
  1532. In the previous section we saw that it is possible to use fonts
  1533. of larger size by using the {\tt \\magstep} control word.  It's
  1534. also possible to magnify the entire document at once. If {\tt
  1535. \\magnification = \\magstep 1} appears at the top of your document,
  1536. then all of your output is magnified by 20\%\null.  The other
  1537. values of {\tt \\magstep} can be used, too. {\bf It should be
  1538. emphasized that {\tt \\magnification} can only be used before
  1539. even a single character is typeset.}  This magnification creates
  1540. a problem in units; if the document is to be magnified by 20\%
  1541. and {\tt \\hsize = 5 in} appears in the \TeX{} input file, should
  1542. the final output have an {\tt \\hsize} of 5 inches or should it
  1543. be magnified by 20\% to 6 inches? Unless told otherwise, all the
  1544. dimensions will be magnified so that, in this case, {\tt \\hsize}
  1545. would be 6 inches in the final output.  This means that all the
  1546. dimensions will increase uniformly when {\tt \\magnification} is
  1547. used.  But for some special situations it might not be desirable
  1548. for this to happen; for example, you might want to leave a space
  1549. of exactly 3 inches to insert a figure.  In this case any unit
  1550. can be modified by {\tt true} so that {\tt \\hsize = 5 true in}
  1551. will always set the line width to 5 inches, regardless of
  1552. magnification. \TeXref{59--60} \toindex{magnification}
  1553.  
  1554. \exercise Put {\tt \\magnification = \\magstep 1} as the first
  1555. line in one of your input files and see how the output changes.
  1556.  
  1557. \subsection{Paragraph shape}
  1558.  
  1559. When \TeX{} is reading the text to be typeset from your input
  1560. file, it reads in a paragraph at a time and then typesets it.
  1561. This means that there is a lot of control over paragraph shapes,
  1562. but also that some care must be taken.  We've already seen that
  1563. {\tt \\hsize} can be used to control the width of a single
  1564. paragraph.  But suppose the following appeared as part of your
  1565. input file:
  1566.  
  1567. \beginuser
  1568. \\hsize = 5 in
  1569. Four score and seven years $\ldots$
  1570. $\vdots$
  1571. $\ldots$ from this earth.
  1572. \\hsize = 6.5 in
  1573.  
  1574. \enduser
  1575.  
  1576. What is the width of the paragraph?  The {\tt \\hsize} was
  1577. changed at the start of the paragraph and again at the end.
  1578. Since the paragraph was not completed (by putting in a blank line
  1579. or {\tt \\par}) until after the second change, the paragraph
  1580. would be typeset with a width of 6.5 inches. However, if a blank
  1581. line were inserted before {\tt \\hsize = 6.5 in}, then the
  1582. paragraph would be typeset with a width of 5 inches.  So, in
  1583. general, when a paragraph is set, the values of the parameters
  1584. that are in effect when the paragraph is completed are the ones
  1585. that are used.
  1586.  
  1587. Here is a table with some paragraph parameters:
  1588.  
  1589. \maketable [Some paragraph shape parameters]
  1590. \halign{
  1591.    \strut \hfil # & \quad \hfil \tt # \hfil & \hfil \quad # \hfil\cr
  1592.    \bf Function & \bf \TeX{} Control Word & \bf \TeX{} default\cr
  1593.    \noalign{\hrule} \noalign{\smallskip}
  1594.    width & \\hsize & 6.5 inches \cr
  1595.    indentation on first line & \\parindent & 20 points\cr
  1596.    distance between lines   & \\baselineskip & 12 points\cr
  1597.    distance between paragraphs & \\parskip & 0 points \cr
  1598.       }
  1599.  
  1600. \toindex{parindent}
  1601. \toindex{parskip}
  1602. \toindex{baselineskip}
  1603.  
  1604. The control word {\tt \\noindent} may be used at the beginning of
  1605. a paragraph to avoid the automatic indentation on the first line.
  1606. This control word will only affect the paragraph being set when
  1607. it is invoked (of course {\tt \\parindent = 0 pt} will cause no
  1608. indentation for all paragraphs).
  1609. \toindex{noindent}
  1610.  
  1611. {\narrower
  1612. A more flexible way to control the width of a paragraph is to use
  1613. {\tt \\rightskip} and {\tt \\leftskip}.  Setting {\tt \\leftskip
  1614. = 20 pt} causes the left margin of the paragraph to be moved in
  1615. an extra twenty points. Negative values may be assigned to {\tt
  1616. \\leftskip} to move the left margin out. The control word {\tt
  1617. \\rightskip} does the same to the right side of the paragraph.
  1618. The single control word {\tt \\narrower} is the equivalent of
  1619. setting both {\tt \\leftskip} and {\tt \\rightskip} equal to {\tt
  1620. \\parindent}.  This is quite useful for long quotations, and
  1621. this paragraph is an example of its use. As with {\tt \\hsize},
  1622. the value of {\tt \\leftskip} and {\tt \\rightskip} in effect
  1623. when the paragraph is completed is the one which will apply to
  1624. the whole paragraph.
  1625. \TeXref{100}
  1626.  
  1627. }
  1628. \toindex{leftskip}
  1629. \toindex{rightskip}
  1630. \toindex{narrower}
  1631.  
  1632. \exercise Make two paragraphs with the following specifications:
  1633. the left margin of both paragraphs is indented by 1.5 inches,
  1634. the right margin of the first paragraph is indented by 0.75
  1635. inches, and the right margin of the second paragraph is indented
  1636. by 1.75 inches.
  1637. \bigskip
  1638.  
  1639. \def\hangparagraph{ Lines can be made with different lengths
  1640. within one paragraph by using {\tt \\hangindent} and {\tt
  1641. \\hangafter}.  The amount of the indentation is determined by value
  1642. of {\tt \\hangindent}. If {\tt \\hangindent} is positive, the
  1643. indentation is made from the left, and if it is negative it is
  1644. made from the right. The lines on which the indentation occurs is
  1645. controlled by {\tt \\hangafter}.  If {\tt \\hangafter} is
  1646. positive then it determines the number of lines at full width
  1647. before the indentation starts.  Thus if {\tt \\hangindent = 1.75
  1648. in} and {\tt \\hangafter = 6}, then the first six lines will be
  1649. at full width and the rest will be indented by 1.75 inches from
  1650. the left. On the other hand if {\tt \\hangindent = \hbox{-1.75}
  1651. in} and {\tt \\hangafter = -6}, then the first six lines will be
  1652. indented by 1.75 inches from the right and the rest will be at
  1653. full width. \TeX{} resets to the default values {\tt \\hangindent
  1654. = 0 pt} and {\tt \\hangafter = 1} after each paragraph. These
  1655. control words are useful for paragraphs with ``hanging indents''
  1656. and for flowing a paragraph around space reserved for a figure.
  1657. \TeXref{355}The control word {\tt \\hang} at the beginning of the
  1658. paragraph will cause the first line to be of full width ({\tt
  1659. \\hangafter=1}) and the rest of the paragraph to be indented by
  1660. the current value of {\tt \\parindent}. But you do have to use
  1661. {\tt \\noindent} if you want the first line to extend all the way
  1662. to the left margin.
  1663. \TeXref{102}
  1664. \par}
  1665.  
  1666. \hangafter=6 \hangindent=1.75in
  1667. \hangparagraph
  1668. \toindex{hangindent}
  1669. \toindex{hangafter}
  1670. \toindex{hang}
  1671.  
  1672. Here is the previous paragraph repeated with {\tt \\hangafter = -6}
  1673. and {\tt \\hangindent = -1.75 in}.
  1674.  
  1675. \hangafter=-6 \hangindent=-1.75in \hangparagraph
  1676.  
  1677.  
  1678. The control word {\tt \\parshape} can be used to make paragraphs with
  1679. a greater variety of shapes.
  1680. \TeXref{101}
  1681. \toindex{parshape}
  1682.  
  1683. Another useful control word for setting paragraphs is {\tt \\item}.
  1684. It can be used to make various types of itemized lists,
  1685. and is invoked using the pattern {\tt \\item\lb$\ldots$\rb}\null.
  1686. This causes the next  paragraph to be formed with every line
  1687. indented by {\tt \\parindent} and, in addition, the first line
  1688. labeled on the left by whatever is between the braces.  It is
  1689. usually used with {\tt \\parskip = 0 pt}, since that control word
  1690. determines the vertical space between the different items. The control
  1691. word {\tt \\itemitem} is the same as {\tt \\item} except that the
  1692. indentation is twice as far, that is, twice the value of
  1693. {\tt \\parindent}.
  1694. \TeXref{102}Here is an example:
  1695. \toindex{item}
  1696. \toindex{itemitem}
  1697.  
  1698. \beginliteral
  1699. \parskip = 0pt \parindent = 30 pt
  1700. \noindent
  1701. Answer all the following questions:
  1702. \item{(1)} What is question 1?
  1703. \item{(2)} What is question 2?
  1704. \item{(3)} What is question 3?
  1705. \itemitem{(3a)} What is question 3a?
  1706. \itemitem{(3b)} What is question 3b?
  1707. @endliteral
  1708.  
  1709.  
  1710. \noindent
  1711. will produce
  1712. \vfill\eject
  1713.  
  1714. {\parskip = 0pt \parindent = 30 pt
  1715. \noindent
  1716. Answer all the following questions:
  1717. \item{(1)} What is question 1?
  1718. \item{(2)} What is question 2?
  1719. \item{(3)} What is question 3?
  1720. \itemitem{(3a)} What is question 3a?
  1721. \itemitem{(3b)} What is question 3b?
  1722.  
  1723. }
  1724.  
  1725. \exercise Make a paragraph several lines long and use it with
  1726. the {\tt \\item} control word to see the ``hanging indent.'' Now
  1727. take the same paragraph and use it with different values of {\tt
  1728. \\parindent} and {\tt \\hsize}.
  1729. \bigskip
  1730.  
  1731. Now let's see how to put space between paragraphs.  The control
  1732. word {\tt \\parskip} is used to determine how much space is
  1733. normally left between paragraphs. So if you put {\tt \\parskip =
  1734. 12 pt} at the beginning of your \TeX{} source file, there will be
  1735. 12 points between paragraphs unless other instructions are
  1736. given. The control word {\tt \\vskip} can be used to insert extra
  1737. vertical space between paragraphs.  If {\tt \\vskip 1 in} or {\tt
  1738. \\vskip 20 pt} appears between two paragraphs, then the extra
  1739. space is inserted.
  1740.  
  1741. There are a couple of peculiarities of {\tt \\vskip} that seem
  1742. quite strange at first.  If you have {\tt \\vskip 3 in} and the
  1743. skip starts two inches from the bottom of the page, the rest of
  1744. the page is skipped, but the extra one inch is {\it not\/}
  1745. skipped at the top of the next page.  In other words, {\tt \\vskip}
  1746. {\bf will not insert space across page boundaries}.  In
  1747. fact, {\tt \\vskip~1~in} will have no effect at all if it happens
  1748. to appear at the top of a page! For many types of vertical
  1749. spacing this is quite appropriate.  The space before a section
  1750. heading, for example, should not continue across page boundaries.
  1751.  
  1752. A similar phenomenon occurs at the beginning of your document.
  1753. If, for example, you want a title page with the title about half
  1754. way down the page, you can not insert the space at the top of the
  1755. page using {\tt \\vskip}.
  1756.  
  1757. But what if you really want some blank space at the top of a
  1758. page? You could start the page with {\tt\\\sp} but this in effect
  1759. typesets a one line paragraph containing a blank. So while
  1760. nothing is typeset, the extra space due to the values of {\tt
  1761. \\baselineskip} and {\tt \\parskip} will add extra space. An easier
  1762. method is to use {\tt \\vglue} instead of {\tt \\vskip} to get
  1763. the desired result.  Thus {\tt \\vglue 1 in\ }will leave one inch
  1764. of blank space at the top of the page.\TeXref{352}
  1765. \toindex{vglue}
  1766.  
  1767.  
  1768. We can note in passing that there is another more general method
  1769. to put material at the top of a page using the control words {\tt
  1770. \\topinsert} and {\tt \\endinsert}. If {\tt \\topinsert $\ldots$
  1771. \\endinsert} is used within a page, the material between
  1772. {\tt \\topinsert} and {\tt \\endinsert} will appear at the top
  1773. of the page, if possible. For example:
  1774.  
  1775. \vbox{
  1776.    \beginuser
  1777.    \\topinsert
  1778.    \\vskip 1 in
  1779.    \\centerline\lb Figure 1\rb
  1780.    \\endinsert
  1781.    \enduser
  1782. }
  1783. \noindent
  1784. is useful for inserting figures of a prescribed size.
  1785. \TeXref{115}
  1786. \toindex{topinsert}
  1787. \toindex{endinsert}
  1788.  
  1789. There are also some special control words for making small
  1790. vertical skips. They are {\tt \\smallskip}, {\tt \\medskip}, and
  1791. {\tt \\bigskip}. Here is the size of each one:
  1792.  
  1793. \def\hrl{\hrule width .5 in}
  1794.  
  1795. \centerline{{\tt \\smallskip}: \vbox{\hrl \smallskip \hrl} \quad
  1796.             {\tt \\medskip}: \vbox{\hrl \medskip \hrl} \quad
  1797.             {\tt \\bigskip}: \vbox{\hrl \bigskip \hrl}
  1798.             }
  1799. \toindex{smallskip}
  1800. \toindex{medskip}
  1801. \toindex{bigskip}
  1802.  
  1803. \subsection{Line shape}
  1804.  
  1805. For most material \TeX{} does a good job of breaking up a
  1806. paragraph into lines.  But sometimes it's necessary to add
  1807. further instructions. It's possible to force a new line by
  1808. inserting {\tt \\hfill \\break} in your input file. It's also
  1809. possible to  put some text on a line by itself using the control
  1810. word {\tt \\line\lb $\ldots$\rb}; then the material between the
  1811. braces will be restricted to one line (although the result will
  1812. be spread out over the whole line and may be horrible). The
  1813. control words {\tt \\leftline\lb $\ldots$\rb}, {\tt \\rightline\lb
  1814. $\ldots$\rb}, and {\tt \\centerline\lb $\ldots$\rb} will,
  1815. respectively, set the material between the braces on a single
  1816. line on the left margin, on the right margin, or \centred.  Thus
  1817. \toindex{hfill}
  1818. \toindex{break}
  1819. \toindex{centerline}
  1820. \toindex{leftline}
  1821. \toindex{rightline}
  1822. \toindex{line}
  1823.  
  1824.  
  1825. \beginliteral
  1826. \leftline{I'm over on the left.}
  1827. \centerline{I'm in the @centre.}
  1828. \rightline{I'm on the right.}
  1829. \line{I just seem to be spread out all over the place.}
  1830. @endliteral
  1831.  
  1832. \noindent
  1833. produces the four lines:
  1834. \vskip\baselineskip
  1835.  
  1836.  
  1837. {
  1838. \hbadness = 10000
  1839. \leftline{I'm over on the left.}
  1840. \centerline{I'm in the \center.}
  1841. \rightline{I'm on the right.}
  1842. \line{I just seem to be spread out all over the place.}
  1843.  
  1844. Other types of spacing can be obtained by using the control word {\tt
  1845. \\hfil}.  This causes all the extra space in the line to be
  1846. accumulated at the position where {\tt \\hfil} appears.
  1847. Thus if we alter our last example to
  1848. {\tt \\line\lb I just seem to be spread out \\hfil all over the place.\rb}
  1849. we will get \hfil\break
  1850. \medskip
  1851. \line{I just seem to be spread out \hfil all over the place.}
  1852. \medskip
  1853. If we have more than one {\tt \\hfil}, they will divide any extra
  1854. space among themselves equally.  Hence
  1855. {\tt \\line\lb left text \\hfil \centre{} text\\hfil right text.\rb}
  1856. will produce
  1857. \medskip
  1858. \line{left text \hfil \centre{} text \hfil right text.}
  1859. \toindex{hfil}
  1860. }
  1861.  
  1862. \exercise Typeset the following line:
  1863.  
  1864. \line{left end \hfil left tackle \hfil left guard \hfil \centre{} \hfil
  1865. right guard \hfil right tackle \hfil right end}
  1866.  
  1867. \exercise Typeset the following line with twice as much space between
  1868. ``left'' and ``right-\centre{}'' as between ``right-\centre{}'' and
  1869. ``right'':
  1870.  
  1871. \line{left \hfil \hfil right-\centre{} \hfil right}
  1872.  
  1873. It's possible to move horizontally using {\tt \\hskip} in a
  1874. manner analogous with {\tt \\vskip}.
  1875. \toindex{hskip}
  1876.  
  1877. \exercise What happens with the following input:\hfil\break
  1878. {\tt \\line\lb\\hskip 1 in ONE \\hfil TWO \\hfil THREE\rb}
  1879. \bigskip
  1880.  
  1881. The right justification can be canceled by using the
  1882. control word {\tt \\raggedright}.
  1883. \toindex{raggedright}
  1884.  
  1885. \subsection{Footnotes}
  1886.  
  1887. The general pattern to make footnotes using \TeX{} is
  1888. {\tt \\footnote\lb$\ldots$\rb\lb$\ldots$\rb}\null.
  1889.  
  1890. The footnote mark goes in between the first set of braces.  Some
  1891. available marks are {\tt \\dag (\dag)}, {\tt \\ddag (\ddag)}, {\tt \\S
  1892. (\S)}, and {\tt \\P (\P)}\null.  The text of the footnote
  1893. goes between the second set of braces. The use of numbers as
  1894. marks is a little less straightforward. The footnote%
  1895. \footnote{${}^{21}$}{This is the footnote at the bottom of the page.}
  1896. at the bottom of the page was produced by using {\tt \\footnote\lb\$\lb
  1897. \rb\^{}\lb{21}\rb\$\rb\lb This is the footnote at the
  1898. bottom of the page.\rb}  after the word ``footnote'' in the
  1899. text. This construction is somewhat complicated; we'll see why
  1900. it's this way when we know a little more about typesetting
  1901. mathematics. But for the moment we can look at it as a way of
  1902. getting the job done. You may want to use {\tt \\rm} within the
  1903. footnote to ensure that the right font appears. Usually you will
  1904. not want a space between the text and the control word {\tt
  1905. footnote}.\TeXref{117}
  1906. \toindex{footnote}
  1907. \toindex{ddag}
  1908. \toindex{S}
  1909. \toindex{P}
  1910.  
  1911. \exercise Make up a page with a relatively long footnote spanning
  1912. several lines.
  1913.  
  1914. \exercise Make up a page with two different footnotes on it.
  1915.  
  1916. \subsection{Headlines and Footlines}
  1917.  
  1918. \headline={\hfil \tenrm Page \the\pageno} %example for this section
  1919.  
  1920. The lines for title and page numbers that go above and below the
  1921. main text are produced by using {\tt \\headline=\lb$\dots$\rb}
  1922. and {\tt \\footline=\lb$\dots$\rb}\null.
  1923. \TeXref{252--253}
  1924.  
  1925. The principle is the same as using the control word {\tt \\line\lb
  1926. $\dots$\rb} within the usual text on the page.  A helpful
  1927. control word is {\tt \\pageno} which represents the current page
  1928. number. Thus {\tt \\headline=\lb\\hfil \\tenrm Page \\the\\pageno\rb}
  1929. would cause the page number to appear in the upper
  1930. right corner preceded by the word ``Page'' (now look at the upper
  1931. right corner of this page). It is safer to explicitly name the
  1932. font that you want to use (in this case {\tt \\tenrm} to use the
  1933. 10 point roman font), since you are never guaranteed that a
  1934. particular font will be in use when the headline or footline is
  1935. set. The control word {\tt \\the} takes the internal value of the
  1936. next word if it is an appropriate control word and prints it as
  1937. text. You can also use the control word {\tt \\folio} instead of
  1938. {\tt \\the \\pageno}. The difference is that {\tt \\folio} will
  1939. give roman numerals when {\tt \\pageno} is negative.
  1940. \toindex{headline}
  1941. \toindex{footline}
  1942. \toindex{pageno}
  1943. \toindex{the}
  1944. \toindex{folio}
  1945.  
  1946. You can also assign values to {\tt \\pageno} if you want your
  1947. document to use a different sequence of page numbers from the
  1948. usual.  Roman numerals can be produced by using negative numbers;
  1949. {\tt \\pageno=-1} at the beginning of a document will cause page
  1950. numbers to be in roman numerals.
  1951. \TeXref{252}
  1952.  
  1953. Different headlines can be produced for even and odd pages in
  1954. the following manner:
  1955.  
  1956. {\tt
  1957. \\headline=\lb\\ifodd \\pageno \lb$\dots$\rb \\else \lb$\dots$\rb
  1958. \\fi\rb}
  1959.  
  1960. \noindent
  1961. where the material between the first set of braces is for the
  1962. right-hand pages and the material between the second set of
  1963. braces is for the left-hand pages.
  1964.  
  1965. \exercise Change the footline so that the page number is \centred{}
  1966. with a en-dash on either side.
  1967.  
  1968. \subsection{Overfull and underfull boxes}
  1969.  
  1970. One of the most frustrating experiences for the new \TeX{} user
  1971. is the occurrence of overfull and underfull boxes.  They are duly
  1972. noted in the log file and are also written to the screen when \TeX{}
  1973. is being run interactively.  Overfull boxes are also marked
  1974. on the output by a slug (a large filled-in black rectangle that
  1975. looks like this: \vrule width \overfullrule) in the right
  1976. margin. Various obscene terms are applied to this slug.  It
  1977. appears even though there is nothing wrong with the \TeX{} input.
  1978. So why is the slug there and what can be done about it?
  1979.  
  1980. A good way to visualize the way \TeX{} organizes a page is to
  1981. think of the printed material as being put into boxes. There are
  1982. two types of boxes: {\sl hboxes\/} and {\sl vboxes}.  Most of the
  1983. time these correspond to the organization of horizontal text
  1984. into lines and vertical paragraphs into pages.  In particular, it
  1985. is the spacing of the words in a hbox corresponding to a line of
  1986. text that causes the slug to appear.
  1987.  
  1988. Recall that \TeX{} reads in the complete paragraph before
  1989. deciding how to break it up into lines.  This is better than
  1990. working a line at a time, since a slight improvement in one line
  1991. might cause catastrophic changes farther down in the paragraph.
  1992. When words are gathered together to form a line, space is added
  1993. between the words to justify the right margin. Very large spaces
  1994. between words is obviously undesirable; the badness of the line
  1995. is a measure of how badly the words are spaced.  An underfull
  1996. hbox means that there is too much space between words.  More
  1997. specifically, the badness of any line is a number between 0
  1998. (perfect) and 10000 (horrible).  There is a parameter called {\tt
  1999. \\hbadness} whose default value is 1000\null.  Any line whose
  2000. badness is greater than {\tt \\hbadness} is reported as an
  2001. underfull hbox.  If the value of {\tt \\hbadness} is increased,
  2002. then fewer underfull hboxes will be reported. In fact {\tt
  2003. \\hbadness = 10000} will suppress the reporting of underfull
  2004. hboxes altogether. Similarly, if the words must be squeezed into
  2005. a line so that the spaces are very small or even so the words
  2006. extend a little into the right margin, then an overfull hbox
  2007. results. \toindex{hbadness}
  2008.  
  2009. %%%%%%%%%%%%%% restore original headline %%%%%%%%%%%%%%%%%%%%%%%%
  2010. \headline={\iftitlepage \hfil \global\titlepagefalse
  2011.                                       \else \gentleheadline \fi}
  2012.  
  2013. In a similar way, sometimes \TeX{} allows a line to be slightly
  2014. longer than {\tt \\hsize} in order to achieve a more balanced
  2015. appearance. The control word {\tt \\tolerance} determines when
  2016. this happens.  If the badness of a line is greater than {\tt
  2017. \\tolerance}, \TeX{} will make the line longer by adding a new word
  2018. at the end of the line, even though it might exceed the value of
  2019. {\tt \\hsize}. A line which is only slightly longer is set
  2020. without being reported. The control word {\tt \\hfuzz} determines
  2021. how much excess is allowed; the default is {\tt \\hfuzz
  2022. =~0.1~pt}.  A line that is more than slightly longer than {\tt \\hsize}
  2023. is obviously a serious problem; \TeX{} puts a slug in
  2024. the margin to make its point forcefully. It's possible to avoid
  2025. overfull hboxes altogether by increasing the value of {\tt \\tolerance}.
  2026. With {\tt \\tolerance = 10000} there will never be
  2027. overfull boxes or slugs. The default is {\tt \\tolerance = 200}\null.
  2028. \TeXref{29}
  2029. \toindex{hfuzz}
  2030. \toindex{tolerance}
  2031.  
  2032. The width of the slug is determined by the control word {\tt
  2033. \\overfullrule}.  Including {\tt \\overfullrule = 0 pt} in your
  2034. file will delete any further  printing of the slugs.  The
  2035. overfull boxes will still be there, of course, and they will
  2036. probably be harder to spot.
  2037. \toindex{overfullrule}
  2038.  
  2039. So we see why overfull boxes and underfull boxes are reported; we
  2040. can also change the reporting by changing the values of {\tt
  2041. \\badness}, {\tt \\hfuzz}, and {\tt \\tolerance}.  In addition, a
  2042. small value of {\tt \\hsize} obviously makes it more difficult to
  2043. set lines and causes more overfull and underfull hboxes to be
  2044. reported. These are warnings that you ignore at your own peril!
  2045.  
  2046. Adding new possibilities of hyphenation will sometimes eliminate
  2047. an overfull box. \TeX{} has automatic hyphenation and usually
  2048. finds good places to hyphenate a word; however, it's possible to
  2049. add hyphenations to let lines break at new places.  For example,
  2050. the automatic hyphenation will never put a hyphen in the word
  2051. ``database''.  If you type in {\tt data\\-base}, it will allow a
  2052. hyphen to be inserted after the second letter ``a'' in the word.
  2053. More generally, if you put {\tt \\hyphenation\lb data-base\rb} in
  2054. the beginning of your input file, then all occurrences of the
  2055. word ``database'' will allow hyphenation after the letter ``a''.
  2056. \TeXref{28} The log file will show the possible hyphenations on
  2057. the line containing the overfull or underfull box. Sometimes the
  2058. best solution to an overfull or underfull hbox is a little
  2059. judicious editing of the original document.
  2060. \toindex{hyphenation}
  2061.  
  2062. Our discussion has involved the setting of type into lines, that is,
  2063. the horizontal page structure.  There are several vertical \analog{}s.
  2064. Overfull and underfull hboxes indicate how well words are gathered
  2065. into lines.  Similarly, overfull and underfull vboxes are reported
  2066. when paragraphs are gathered to form pages.  A large table that
  2067. can't be broken in the middle, for example, can produce an underfull
  2068. vbox that is reported in the log file when the page being typeset is
  2069. completed.  The control word {\tt \\vbadness} works for the vertical
  2070. placement of text in the same way as {\tt \\hbadness} works for
  2071. horizontal text.
  2072. \toindex{vbadness}
  2073.  
  2074. \exercise Take a few paragraphs and print them using various (small)
  2075. values of {\tt \\hsize} to see what kind of overfull boxes result.
  2076. Repeat with various values of {\tt \\hbadness}, {\tt \\hfuzz}, and
  2077. {\tt \\tolerance}.
  2078.  
  2079.  
  2080.  
  2081.  
  2082.  
  2083.  
  2084. \section{$\Bigl\{$Groups, $\bigl\{$Groups,
  2085.         $\{$and More Groups$\}\bigr\}\Bigr\}$}
  2086.  
  2087. The concept of gathering text into groups allows \TeX{} input
  2088. files to be greatly simplified.  A new group is started by the
  2089. character {\tt\lb} and terminated by the character {\tt \rb}\null.
  2090. Changes made within a group will lose their effect when the
  2091. group terminates.  So, for example if {\tt \lb \\bf three
  2092. boldface words\rb} appears in your text, the opening brace starts
  2093. the group, the {\tt \\bf} control word changes to a boldface
  2094. font, and the closing brace finishes up the group.  Upon
  2095. completion of the group the font being used is the one in effect
  2096. before the group started.  This is the (easier) way of having a
  2097. few words in a different font.  It's also possible to have groups
  2098. nested within groups.
  2099.  
  2100. \def\sectiontitle{$\Bigl\{$Groups, $\bigl\{$Groups, $\dots \bigr\}\Bigr\}$}
  2101.  
  2102. As another example, size changes can be made in the text that are
  2103. only temporary.  For example
  2104. \beginuser
  2105. \lb
  2106. \\hsize = 4 in
  2107. \\parindent = 0 pt
  2108. \\leftskip = 1 in
  2109. will produce a paragraph that is four
  2110. $\vdots$
  2111. (this is an easy mistake to make).
  2112. \\par
  2113. \rb
  2114. \enduser
  2115.  
  2116. {\hsize = 4 in
  2117. \parindent = 0 pt
  2118. \leftskip = 1 in
  2119. will produce a paragraph that is four inches wide with the text
  2120. offset into the paragraph by one inch regardless of the settings
  2121. in effect before the start of the group.  This paragraph is set
  2122. with those values. After the end of the group, the old settings
  2123. are in effect again. Note that it is necessary to include
  2124. {\tt \\par} or to use a blank line before the closing brace to end
  2125. the paragraph, since otherwise the group will end and \TeX{} will
  2126. go back to the old parameters before the paragraph is actually
  2127. typeset (this is an easy mistake to make). \par}
  2128.  
  2129. When a control word (like {\tt \\centerline}) acts on text
  2130. following it in braces, that text is implicitly in a group. Thus
  2131. {\tt \\centerline\lb\\bf A bold title\rb} will produce a \centred{}
  2132. boldface line, and the text following that line will be in
  2133. whatever font was in effect before the {\tt \\centerline} was
  2134. invoked.
  2135.  
  2136. The empty group {\tt\lb\rb} is useful.  One use allows accents to be
  2137. typeset with no accompanying letter.  For example, {\tt \\\~{}\lb\rb}
  2138. will print a tilde with no letter under it.  It can also be used to
  2139. stop \TeX{} from eating up consecutive spaces. Hence {\tt I use
  2140. \\TeX\lb\rb{} all the time}  will leave a space after ``\TeX'' in the
  2141. output. This is an alternative to using {\tt \\\sp} as we did in
  2142. Section~1.
  2143. \TeXref{19--21}
  2144.  
  2145. Grouping can also be used to avoid spaces in the middle of a word
  2146. when including accents. Either {\tt soup\\c\sp con} or {\tt
  2147. soup\\c\lb c\rb on} will produce the word soup\c{c}on.
  2148.  
  2149. \exercise Change the dimensions of one paragraph on a page using the
  2150. grouping idea.
  2151.  
  2152. \exercise Mathematicians sometime use the word ``i{f}f'' as an
  2153. abbreviation for ``if and only if''\null.  In this case it looks
  2154. better if the first and second letter ``f'' are {\sl not\/}
  2155. joined as a ligature.  How do you do this (there are several
  2156. solutions)?
  2157.  
  2158. It's really easy to forget to match braces properly.  The effect
  2159. can be dramatic; if you get output that suddenly changes to an
  2160. italic font for the rest of the document, a mismatched brace is
  2161. probably the cause.  If you have an extra {\tt \lb} \TeX{} will
  2162. give a message in the log file: {\tt (\\end occurred inside a
  2163. group at level 1)}. An extra {\tt\rb} will result in the message
  2164. \hbox{\tt! Too many \rb's.}
  2165.  
  2166. Here's a little hint to help you keep track of the braces in more
  2167. complicated groups: put the opening brace on a line by itself and
  2168. do the same for the closing brace.  If there are braces nested
  2169. within the original ones, put them on separate lines also, but
  2170. indent them a few spaces.  The text within the nested braces can
  2171. also be indented since \TeX{} ignores all spaces at the beginning
  2172. of a line. The matching braces will then stand out when you look
  2173. at your \TeX{} source file.  In fact, if your editor is smart
  2174. enough, you can create the two lines with the braces first and
  2175. then insert the appropriate material within them with automatic
  2176. indenting.
  2177.  
  2178. \exercise In section 2 we changed fonts the following method:
  2179. {\tt I started with roman type, \\it switched to italic type,
  2180. \\rm and returned to roman type}. Get the same result using the
  2181. idea of grouping.
  2182.  
  2183.  
  2184. \section{No math anxiety here!}
  2185.  
  2186. \TeX{} is at its best when typesetting mathematics.  The
  2187. conventions for doing this are many and complex, and the ability
  2188. of \TeX{} to take them into account makes the production of high
  2189. quality, attractive mathematical output possible.  If you plan to
  2190. produce papers with mathematical symbols in them, this section
  2191. will give you all the basics necessary for creating beautiful
  2192. output in almost all circumstances; \TeX{} may be used without
  2193. any mathematics, of course, and if this is your goal, then the
  2194. following two subsections are probably sufficient for your needs.
  2195.  
  2196. \subsection{Lots of new symbols}
  2197.  
  2198. Mathematical text is inserted into normal text in two possible
  2199. ways: it can be {\sl in-line\/}, that is, as part of the usual
  2200. lines of text.  It can also be {\sl displayed}, that is, \centred{}
  2201. in a gap between the usual text.  The results in the spacing and
  2202. placement of symbols can be quite different in each case.  The
  2203. in-line equation $\sum_{k=1}^{\infty} {1\over k^2} = {\pi^2\over6}$
  2204. is easily seen to be different from the same equation when
  2205. displayed:
  2206. $$\sum_{k=1}^{\infty} {1\over k^2} = {\pi^2\over6}.$$
  2207.  
  2208. Since the spacing and the fonts used for mathematics are quite
  2209. different from those of ordinary text, \TeX{} needs to be told
  2210. when mathematics rather than normal text is being typeset.  This
  2211. is done using the {\tt\$} symbol.  More specifically, mathematics
  2212. is typeset in-line by surrounding the symbols to be entered by
  2213. single dollar signs: {\tt \$$\ldots$\$}, and is typeset displayed
  2214. by surrounding the symbols to be entered by double dollar signs:
  2215. {\tt \$\$$\ldots$\$\$}\null.  Hence {\tt \$x = y+1\$} will give
  2216. $x=y+1$ in-line while {\tt \$\$x = y+1.\$\$} will display
  2217. $$x=y+1.$$
  2218.  
  2219. The spacing for both in-line and displayed mathematics is
  2220. completely controlled by \TeX\null.  Adding spaces to your input
  2221. has no effect at all.  What if you need a space or some text in
  2222. the middle of some mathematics?  You can insert text by inserting
  2223. it into an hbox (don't worry about the definition of an hbox for
  2224. now): {\tt \\hbox\lb$\ldots$\rb}\null.  This is particularly
  2225. useful for displayed mathematics.  Hence ``$x=y+1 \hbox{ whenever
  2226. } y=x-1$'' can be typeset using {\tt \$x=y+1 \\hbox\lb\ whenever
  2227. \rb y=x-1\$}. Note the spaces on either side of the word within
  2228. the braces. Usually it isn't necessary to insert spaces into
  2229. mathematical text, but here are the control sequences that do the
  2230. job.
  2231. \TeXref{167}
  2232.  
  2233. \maketable [Adding space to mathematical text]
  2234. \halign{
  2235. \strut \hfil # & \quad \hfil\tt# \hfil \quad
  2236.    & \hbox to 2cm{\hrulefill\vrule height 8pt#\vrule height 8pt\hrulefill} \cr
  2237.    Name & \rm Control Sequence & \hfil{}$\gets$Size$\to$\cr
  2238.    \noalign{\hrule} \noalign{\smallskip}
  2239.    Double quad         & \\qquad &\qquad \cr
  2240.    Quad                & \\quad  &\quad \cr
  2241.    Space               & \\\sp\   &\ \cr
  2242.    Thick space         & \\;     &$\;$\cr
  2243.    Medium space        & \\>     &$\>$\cr
  2244.    Thin space          & \\,     &$\,$\cr
  2245.    Negative thin space & \ \\!\    &$\!$\cr
  2246.        }
  2247.  
  2248. \toindex{quad}
  2249. \toindex{qquad}
  2250. \toindex{\sp}
  2251. \toindex{;}
  2252. \toindex{>}
  2253. \toindex{,}
  2254. \toindex{!}
  2255.  
  2256. If you look closely at the negative thin space, you'll notice
  2257. that, unlike the other entries, the two arms overlap.  This is
  2258. because the negative space is one in the opposite direction, that
  2259. is, while the other control sequences increase the amount of
  2260. space between two symbols being typeset, the negative thin space
  2261. decreases the space between them, even if it causes them to
  2262. overlap.
  2263.  
  2264. \exercise Typeset the following: $C(n,r) = n!/(r!\,(n-r)!)$\null. Note the
  2265. spacing in the denominator.
  2266. \bigskip
  2267.  
  2268. You shouldn't have any blank lines between the dollar signs
  2269. delimiting the mathematical text. \TeX{} assumes that all the
  2270. mathematical text being typeset is in one paragraph, and a blank
  2271. line starts a new paragraph; consequently, this will generate an
  2272. error message. This turns out to be useful, for one of the
  2273. easiest errors to make is to forget to put in the trailing dollar
  2274. sign(s) after the mathematical input (I promise that you'll do it
  2275. at least once while learning \TeX{}); if \TeX{} allowed more than
  2276. one paragraph to be between the dollars signs, then one omitted
  2277. trailing dollar sign might cause the rest of the document to be
  2278. typeset as mathematics.
  2279.  
  2280. Most mathematical text is entered in exactly the same way for
  2281. in-line typesetting as for displayed typesetting (except for the
  2282. surrounding dollar signs, of course). The exceptions, such as
  2283. aligning multiline displays and placing equation numbers at the
  2284. left or right margin will be discussed in the last part of this
  2285. section.
  2286.  
  2287. Many new symbols can appear when typesetting mathematics.  Most
  2288. of the ones that actually appear on the keyboard can be used
  2289. directly. The symbols {\tt + - / * = ' | < > (} and {\tt )} are
  2290. all entered directly. Here they are as mathematics: $+ - / * =\>
  2291. '\> | <\> >\> ( \> )$.
  2292.  
  2293. \exercise Typeset the equation $a+b=c-d=xy=w/z$ as in-line and
  2294. displayed mathematical text.
  2295.  
  2296. \exercise Typeset the equation $(fg)' = f'g + fg'$ as in-line and
  2297. displayed mathematical text.
  2298. \bigskip
  2299.  
  2300. Many other symbols, as you would expect, are predefined control
  2301. words.  All Greek letters are available.  Here is a table of them:
  2302. \TeXref{434}
  2303.  
  2304. \maketable [Greek letters]
  2305. \halign{
  2306. \strut \hfil$#$ & \quad \tt# \hfil \qquad &\hfil$#$ & \quad \tt# \hfil \qquad
  2307.       &\hfil$#$ & \quad \tt# \hfil \qquad &\hfil$#$ & \quad \tt# \hfil \cr
  2308. \noalign{\hrule} \noalign{\smallskip}
  2309. \alpha & \\alpha &\beta & \\beta &\gamma & \\gamma &\delta & \\delta \cr
  2310. \epsilon & \\epsilon & \varepsilon & \\varepsilon & \zeta & \\zeta &
  2311. \eta & \\eta \cr
  2312. \theta & \\theta & \vartheta & \\vartheta & \iota & \\iota & \kappa &
  2313. \\kappa \cr
  2314. \lambda & \\lambda & \mu & \\mu & \nu & \\nu & \xi & \\xi \cr
  2315. o & o & \pi & \\pi & \rho & \\rho & \varrho & \\varrho \cr
  2316. \sigma & \\sigma & \varsigma & \\varsigma & \tau & \\tau & \upsilon &
  2317. \\upsilon \cr
  2318. \phi & \\phi & \varphi & \\varphi & \chi & \\chi & \psi & \\psi \cr
  2319. \omega & \\omega & \Gamma & \\Gamma & \Delta & \\Delta & \Theta &
  2320. \\Theta \cr
  2321. \Lambda & \\Lambda & \Xi & \\Xi & \Pi & \\Pi & \Sigma & \\Sigma \cr
  2322. \Upsilon & \\Upsilon & \Phi & \\Phi & \Psi & \\Psi & \Omega & \\Omega \cr
  2323.        }
  2324.  
  2325. \toindex{alpha}
  2326. \toindex{beta}
  2327. \toindex{gamma}
  2328. \toindex{delta}
  2329. \toindex{epsilon}
  2330. \toindex{varepsilon}
  2331. \toindex{zeta}
  2332. \toindex{eta}
  2333. \toindex{theta}
  2334. \toindex{vartheta}
  2335. \toindex{iota}
  2336. \toindex{kappa}
  2337. \toindex{lambda}
  2338. \toindex{mu}
  2339. \toindex{nu}
  2340. \toindex{xi}
  2341. \toindex{pi}
  2342. \toindex{rho}
  2343. \toindex{varrho}
  2344. \toindex{sigma}
  2345. \toindex{varsigma}
  2346. \toindex{tau}
  2347. \toindex{upsilon}
  2348. \toindex{phi}
  2349. \toindex{varphi}
  2350. \toindex{chi}
  2351. \toindex{psi}
  2352. \toindex{omega}
  2353. \toindex{Gamma}
  2354. \toindex{Delta}
  2355. \toindex{Theta}
  2356. \toindex{Lambda}
  2357. \toindex{Xi}
  2358. \toindex{Pi}
  2359. \toindex{Sigma}
  2360. \toindex{Upsilon}
  2361. \toindex{Phi}
  2362. \toindex{Psi}
  2363. \toindex{Omega}
  2364.  
  2365.  
  2366. \exercise Typeset $\alpha\beta=\gamma+\delta$ as in-line and displayed
  2367. mathematical text.
  2368.  
  2369. \exercise Typeset $\Gamma(n) = (n-1)!$ as in-line and displayed
  2370. mathematical text.
  2371.  
  2372. Sometimes accents are put above or below symbols.  The control
  2373. words used for accents in mathematics are different from those
  2374. used for normal text.   The normal text control words may not be
  2375. used for mathematics and vice-versa.
  2376. \TeXref{135--136}
  2377.  
  2378. \maketable [Mathematical accents]
  2379. \halign{
  2380.    \strut \hfil$#$ & \quad \tt# \hfil \qquad &\hfil$#$ &
  2381.       \quad \tt# \hfil \qquad &\hfil$#$ & \quad \tt# \hfil \qquad  \cr
  2382.    \noalign{\hrule} \noalign{\smallskip}
  2383.    \hat o   & \\hat o   & \check o & \\check o  & \tilde o & \\tilde o \cr
  2384.    \acute o & \\acute o & \grave o & \\grave o  & \dot o & \\dot o \cr
  2385.    \ddot o  & \\ddot o  &\breve o  & \\breve o  & \bar o & \\bar o \cr
  2386.    \vec o   & \\vec o   & \widehat {abc} & \\widehat \lb abc\rb
  2387.                     & \widetilde {abc} & \\widetilde \lb abc\rb\cr
  2388.        }
  2389.  
  2390. \toindex{hat}
  2391. \toindex{check}
  2392. \toindex{tilde}
  2393. \toindex{acute}
  2394. \toindex{grave}
  2395. \toindex{dot}
  2396. \toindex{ddot}
  2397. \toindex{breve}
  2398. \toindex{bar}
  2399. \toindex{vec}
  2400. \toindex{widehat}
  2401. \toindex{widetilde}
  2402.  
  2403.  
  2404.  
  2405. Binary operators combine two mathematical objects to get another
  2406. object.  Ordinary addition and multiplication, for example,
  2407. combine two numbers to get another number, and so they are binary
  2408. operators. When a binary operator such as $+$ or $\times$ is
  2409. typeset, a little extra space is put around it. Here is a list of
  2410. some of the available binary operators:
  2411. \TeXref{436}
  2412.  
  2413. \maketable [Binary operators]
  2414. \halign{
  2415. \strut \hfil$#$ & \quad \tt# \hfil \qquad &\hfil$#$ & \quad \tt# \hfil \qquad
  2416.       &\hfil$#$ & \quad \tt# \hfil \qquad &\hfil$#$ & \quad \tt# \hfil \cr
  2417. \noalign{\hrule} \noalign{\smallskip}
  2418. \cdot & \\cdot &\times & \\times &\ast & \\ast &\star & \\star \cr
  2419. \circ & \\circ & \bullet & \\bullet & \div & \\div & \diamond & \\diamond \cr
  2420. \cap & \\cap & \cup & \\cup & \vee & \\vee & \wedge & \\wedge \cr
  2421. \oplus & \\oplus &\ominus & \\ominus & \otimes &\\otimes &\odot &\\odot \cr
  2422.        }
  2423.  
  2424. \toindex{cdot}
  2425. \toindex{times}
  2426. \toindex{ast}
  2427. \toindex{star}
  2428. \toindex{circ}
  2429. \toindex{bullet}
  2430. \toindex{div}
  2431. \toindex{diamond}
  2432. \toindex{cap}
  2433. \toindex{cup}
  2434. \toindex{vee}
  2435. \toindex{wedge}
  2436. \toindex{oplus}
  2437. \toindex{ominus}
  2438. \toindex{otimes}
  2439. \toindex{odot}
  2440.  
  2441. Ellipses are commonly used with binary operators.  The control
  2442. word {\tt \\cdots} will raise the dots so that they are level
  2443. with the binary operator. Thus {\tt \$a + \\cdots + z\$} will
  2444. produce $a + \cdots + z$.  The control word {\tt \\ldots} will
  2445. put the dots on the baseline, and so {\tt \$1\\ldots n\$}
  2446. produces $1\ldots n$.
  2447. \toindex{cdots}
  2448. \toindex{ldots}
  2449.  
  2450. \exercise Typeset: $x\wedge (y\vee z) = (x\wedge y) \vee (x\wedge z)$.
  2451.  
  2452. \exercise Typeset: $2+4+6+\cdots +2n = n(n+1)$.
  2453. \bigskip
  2454.  
  2455. A relation indicates a property of two mathematical objects.  We
  2456. already know how to show two objects equal, or how to show one
  2457. number less than or greater than another number (since these are
  2458. symbols on most terminal keyboards).  To negate a relation, the
  2459. control word {\tt \\not} is put in front of the relation.  Here
  2460. are some relations:
  2461. \TeXref{436}
  2462. \toindex{not}
  2463.  
  2464. \maketable [Relations ]
  2465. \halign{
  2466. \strut \hfil$#$ & \quad \tt# \hfil \qquad &\hfil$#$ & \quad \tt# \hfil \qquad
  2467.       &\hfil$#$ & \quad \tt# \hfil \qquad &\hfil$#$ & \quad \tt# \hfil \cr
  2468. \noalign{\hrule} \noalign{\smallskip}
  2469. \leq  & \\leq  &\not\leq & \\not \\leq
  2470.        & \geq & \\geq & \not\geq & \\not \\geq \cr
  2471. \equiv & \\equiv & \not\equiv & \\not \\equiv
  2472.        & \sim & \\sim & \not\sim & \\not \\sim \cr
  2473. \simeq & \\simeq & \not\simeq & \\not \\simeq
  2474.        & \approx & \\approx & \not\approx & \\not \\approx \cr
  2475. \subset & \\subset & \subseteq & \\subseteq
  2476.         & \supset & \\supset & \supseteq & \\supseteq \cr
  2477. \in & \\in & \ni & \\ni & \parallel & \\parallel & \perp & \\perp \cr
  2478.        }
  2479.  
  2480. \toindex{leq}
  2481. \toindex{geq}
  2482. \toindex{equiv}
  2483. \toindex{sim}
  2484. \toindex{simeq}
  2485. \toindex{approx}
  2486. \toindex{subset}
  2487. \toindex{subseteq}
  2488. \toindex{supset}
  2489. \toindex{supseteq}
  2490. \toindex{in}
  2491. \toindex{ni}
  2492. \toindex{parallel}
  2493. \toindex{perp}
  2494.  
  2495.  
  2496. \exercise
  2497. Typeset: $\vec x\cdot \vec y  = 0$ if and only if $\vec x \perp \vec y$.
  2498.  
  2499. \exercise
  2500. Typeset: $\vec x\cdot \vec y \not= 0$ if and only if $\vec x \not\perp \vec y$.
  2501.  
  2502. Here are some other available mathematical symbols:\TeXref{435--438}
  2503.  
  2504. \maketable [Miscellaneous symbols ]
  2505. \halign{
  2506. \strut \hfil$#$ & \quad \tt# \hfil \qquad &\hfil$#$ & \quad \tt# \hfil \qquad
  2507.       &\hfil$#$ & \quad \tt# \hfil \qquad &\hfil$#$ & \quad \tt# \hfil \cr
  2508. \noalign{\hrule} \noalign{\smallskip}
  2509. \aleph & \\aleph & \ell & \\ell & \Re & \\Re & \Im & \\Im \cr
  2510. \partial & \\partial & \infty & \\infty & \| & \\| & \angle & \\angle \cr
  2511. \nabla & \\nabla & \backslash &\\backslash & \forall & \\forall
  2512.               & \exists & \\exists \cr
  2513. \neg & \\neg & \flat & \\flat & \sharp & \\sharp & \natural & \\natural \cr
  2514.           }
  2515.  
  2516. \toindex{aleph}
  2517. \toindex{ell}
  2518. \toindex{Re}
  2519. \toindex{Im}
  2520. \toindex{partial}
  2521. \toindex{infty}
  2522. \toindex{|}
  2523. \toindex{angle}
  2524. \toindex{nabla}
  2525. \toindex{backslash}
  2526. \toindex{forall}
  2527. \toindex{exists}
  2528. \toindex{neg}
  2529. \toindex{flat}
  2530. \toindex{sharp}
  2531. \toindex{natural}
  2532.  
  2533. \exercise Typeset: $(\forall x\in \Re)(\exists y\in\Re)$ $y>x$.
  2534.  
  2535. \subsection{Fractions}
  2536.  
  2537. There are two methods of typesetting a fraction: it can be
  2538. typeset either in the form $1/2$ or in the form ${1\over2}$\null.
  2539. The first case is just entered with no special control sequences,
  2540. that is, {\tt \$1/2\$}\null.  The second case uses the control
  2541. word {\tt \\over} and the following pattern: {\tt \lb
  2542. <numerator> \\over <denominator>\rb}\null. Hence {\tt \$\$\lb a+b
  2543. \\over c+d\rb.\$\$} gives $${a+b\over c+d}.$$
  2544. \TeXref{139--140}
  2545. \toindex{over}
  2546.  
  2547. \exercise Typeset the following: ${a+b\over c}\quad {a\over b+c}
  2548. \quad {1\over a+b+c} \not= {1\over a}+{1\over b}+{1\over c}$.
  2549.  
  2550. \exercise Typeset: What are the points where
  2551. ${\partial \over \partial x} f(x,y) = {\partial \over \partial y}
  2552. f(x,y) = 0$?
  2553.  
  2554. \subsection{Subscripts and superscripts}
  2555.  
  2556. Subscripts and superscripts are particularly easy to enter using
  2557. \TeX\null. The characters {\tt \_{}} and {\tt \^{}} are used to
  2558. indicate that the next character is a subscript or a superscript.
  2559. Thus {\tt \$x\^{}2\$} gives $x^2$ and {\tt \$x\_{}2\$} gives
  2560. $x_2$\null.  To get several characters as a subscript or
  2561. superscript, they are grouped together within braces. Hence we
  2562. can use {\tt \$x\^{}\lb 21\rb\$} to get $x^{21}$ and {\tt \$x\_{}\lb
  2563. 21\rb\$} to get $x_{21}$\null. Notice that the
  2564. superscripts and subscripts are automatically typeset in a
  2565. smaller type size. The situation is only slightly more
  2566. complicated for a second layer of subscripts or superscripts.
  2567. You can {\sl not\/} use {\tt \$x\_{}2\_{}3\$} since this could
  2568. have two possible interpretations, namely, {\tt \$x\_{}\lb 2\_{}3\rb\$}
  2569. or {\tt \$\lb x\_{}2\rb\_{}3\$}; this gives two
  2570. different results: $x_{2_3}$ and ${x_2}_3$, the first of which is
  2571. the usual mathematical subscript notation.  Thus you must put in
  2572. the complete braces to describe multiple layers of subscripts and
  2573. superscripts.  They may be done to any level.
  2574. \TeXref{128--130}
  2575.  
  2576. To use both subscripts and superscripts on one symbol, you use
  2577. both the {\tt \_{}} and {\tt \^{}} in either order.  Thus either
  2578. {\tt \$x\_{}2\^{}1\$} or {\tt\$x\^{}1\_{}2\$} will give $x_2^1$.
  2579.  
  2580. \exercise
  2581. Typeset each of the following: $e^x \quad e^{-x} \quad
  2582. e^{i\pi}+1=0 \quad x_0 \quad x_0^2 \quad {x_0}^2 \quad 2^{x^x}$.
  2583.  
  2584. \exercise Typeset:
  2585. $\nabla^2 f(x,y) = {\partial^2 f \over\partial x^2}
  2586. + {\partial^2 f \over\partial y^2}$.
  2587. \bigskip
  2588.  
  2589. A similar method is used for summations and integrals.  The input
  2590. of {\tt \$\\sum\_{}\lb k=1\rb\^{}n k\^{}2\$} will give $\sum_{k=1}^n
  2591. k^2$, and {\tt \$\\int\_{}0\^{}x f(t) dt\$} will
  2592. give $\int_0^x f(t) dt$.
  2593. \TeXref{144--145}
  2594. \toindex{sum}
  2595. \toindex{int}
  2596.  
  2597. Another use of this type of input is for expressions
  2598. involving limits.  You can use
  2599. {\tt \$\\lim\_\lb n\\to \\infty\rb (\lb n+1 \\over n\rb)\^{}n = e\$}
  2600. to get $\lim_{n\to \infty} ({n+1\over n})^n = e$.
  2601. \toindex{lim}
  2602.  
  2603. \exercise Typeset the following expression: $\lim_{x\to 0}
  2604. (1+x)^{1\over x}=e$.
  2605.  
  2606. \exercise Typeset: The cardinality of $(-\infty, \infty)$ is $\aleph_1$.
  2607.  
  2608. \exercise Typeset: $\lim_{x\to {0^+}} x^x = 1$.
  2609. \bigskip
  2610.  
  2611. Here's a hint to make integrals look a little nicer: look at the
  2612. difference between $\int_0^x f(t) dt$ and $\int_0^x f(t)\, dt$\null.
  2613. In the second case there is a little extra space after
  2614. $f(t)$, and it looks nicer; {\tt \\,} was used to add the
  2615. additional space.
  2616. \toindex{,}
  2617.  
  2618. \exercise Typeset the following integral: $\int_0^1 3x^2\,dx = 1$.
  2619.  
  2620. \subsection{Roots, square and otherwise}
  2621.  
  2622. To typeset a square root it is only necessary to use the construction
  2623. {\tt \\sqrt\lb$\ldots$\rb}\null. Hence {\tt \$\\sqrt\lb x\^{}2+y\^{}2\rb\$}
  2624. will give $\sqrt{x^2+y^2}$\null.  Notice that \TeX{} takes care of the
  2625. placement of symbols and the height and length of the radical.
  2626. To make cube or other roots, the control words {\tt \\root} and {\tt
  2627. \\of} are used.  You get $\root n \of {1+x^n}$ from the
  2628. input\TeXref{130--131} {\tt \$\\root n \\of \lb1+x\^{}n\rb\$}.
  2629. \toindex{root}
  2630. \toindex{sqroot}
  2631.  
  2632. A possible alternative is to use the control word {\tt \\surd}; the
  2633. input {\tt \$\\surd 2\$} will produce $\surd 2$.
  2634. \toindex{surd}
  2635.  
  2636. \exercise Typeset the following: $\sqrt2 \quad \sqrt {x+y\over x-y}
  2637. \quad \root 3 \of {10}$ \quad $e^{\sqrt x}$.
  2638.  
  2639. \exercise Typeset: $\|x\| = \sqrt{x\cdot x}$.
  2640.  
  2641. \exercise Typeset:
  2642. $\phi(t) = {1 \over \sqrt{2\pi}} \int_0^t e^{-x^2/2}\,dx$.
  2643.  
  2644.  
  2645. \subsection{Lines, above and below}
  2646.  
  2647. Use the constructions {\tt \\overline\lb$\ldots$\rb} and
  2648. {\tt \\underline\lb$\ldots$\rb} to put lines above or below mathematical
  2649. expressions. Hence {\tt \$\\overline\lb x+y\rb=\\overline x + \\overline
  2650. y\$} gives $\overline{x+y}=\overline x + \overline y$\null.
  2651. But notice that the lines over the letters are at
  2652. different heights, and so some care is necessary. The use of {\tt
  2653. \\overline\lb\\strut x\rb} will raise the height of the line
  2654. over\TeXref{130--131} $x$\null.
  2655. \toindex{overline}
  2656. \toindex{underline}
  2657.  
  2658. To underline non-mathematical text, use {\tt \\underbar\lb$\dots$\rb}.
  2659. \toindex{underbar}
  2660.  
  2661. \exercise Typeset the following: $\underline x \quad \overline y
  2662. \quad \underline{\overline{x+y}}$.
  2663.  
  2664.  
  2665. \subsection{Delimiters large and small}
  2666.  
  2667. The most commonly used mathematical delimiters are brackets,
  2668. braces, and parentheses.  As we have seen, they may be produced
  2669. by using {\tt [ ] \\\lb\ \\\rb\ ( )} to get $[\>]\>\{\>\}\>(\>)\>$.
  2670. Sometimes larger delimiters increase the clarity of
  2671. mathematical expressions, as in $$\bigl(a\times(b+c)\bigr) \bigl((a\times
  2672. b)+c\bigr).$$ To make larger left delimiters the
  2673. control words {\tt \\bigl}, {\tt \\Bigl}, {\tt \\biggl}, and {\tt
  2674. \\Biggl} are used in front of the delimiter; similarly, {\tt \\bigr},
  2675. {\tt \\Bigr}, {\tt \\biggr}, and {\tt \\Biggr} are used
  2676. for the right delimiters. Hence {\tt \$\\Bigl[\$} and {\tt \$\\Bigr]\$}
  2677. will produce $\Bigl[$ and $\Bigr]$.
  2678. \TeXref{145--147}
  2679.  
  2680. \toindex{bigl}
  2681. \toindex{Bigl}
  2682. \toindex{biggl}
  2683. \toindex{Biggl}
  2684. \toindex{bigr}
  2685. \toindex{Bigr}
  2686. \toindex{biggr}
  2687. \toindex{Biggr}
  2688.  
  2689. Here is a table to compare the size of some of the delimiters.
  2690.  
  2691. %% \everycr can add 4 points between lines in the following table %%
  2692. \everycr={\noalign{\vskip 4 pt}}
  2693. \maketable [Delimiters of various sizes]
  2694. \halign{
  2695. \strut \hfil$#$ & \quad \tt# \hfil \quad\qquad
  2696.       &\hfil$#$ & \quad \tt# \hfil \quad\qquad
  2697.       &\hfil$#$ & \quad \tt# \hfil \quad\qquad
  2698.       &\hfil$#$ & \quad \tt# \hfil \cr
  2699. \noalign{\hrule} \noalign{\smallskip}
  2700. \{ & \\\lb & \} & \\\rb & ( & ( & ) & )\cr
  2701. \bigl\{ & \\bigl\\\lb & \bigr\} & \\bigr\\\rb & \bigl( & \\bigl( & \bigr) &
  2702. \\bigr)\cr
  2703. \Bigl\{ & \\Bigl\\\lb & \Bigr\} & \\Bigr\\\rb & \Bigl( & \\Bigl( & \Bigr) &
  2704. \\Bigr)\cr
  2705. \biggl\{ & \\biggl\\\lb & \biggr\} & \\biggr\\\rb & \biggl(
  2706.          & \\biggl( & \biggr) & \\biggr) \cr
  2707. \Biggl\{ & \\Biggl\\\lb & \Biggr\} & \\Biggr\\\rb & \Biggl(
  2708.          & \\Biggl( & \Biggr) & \\Biggr)\cr
  2709.        }
  2710.  
  2711. \everycr={}
  2712.  
  2713. If you want, you can let \TeX{} choose the size of delimiter by
  2714. using the control words {\tt \\left} and {\tt \\right} before
  2715. your delimiters.
  2716. \TeXref{148}Thus {\tt \\left[$\ldots$\\right]}  will cause the material
  2717. to be enclosed by brackets that are appropriately big.  {\bf Note
  2718. well:} each use of a {\tt \\left} delimiter must have a matching
  2719. {\tt \\right} delimiter (although the delimiters themselves may be
  2720. different). Hence {\tt \$\$\\left|\lb a+b \\over
  2721. c+d\rb\\right|.\$\$} gives $$\left|{a+b \over c+d}\right|.$$
  2722.  
  2723. \maketable [Mathematical delimiters]
  2724. \halign{
  2725. \strut \hfill$#$ & \quad \tt # \qquad\qquad &
  2726.        \hfill$#$ & \quad \tt # \qquad\qquad &
  2727.        \hfill$#$ & \quad \tt #  \cr
  2728. \noalign{\hrule} \noalign{\smallskip}
  2729. (       & (        & )          & )           & [        & [         \cr
  2730. ]       & ]        &\{          & \\\lb       & \}       & \\\rb     \cr
  2731. \lfloor & \\lfloor &\rfloor     &\\rfloor     & \lceil   & \\lceil   \cr
  2732. \rceil  & \\rceil  &\langle     & \\langle    & \rangle  & \\rangle  \cr
  2733. /       & /        & \backslash & \\backslash &|         & |         \cr
  2734. \|      & \\|      &\uparrow    & \\uparrow   & \Uparrow & \\Uparrow \cr
  2735. \downarrow & \\downarrow & \Downarrow & \\Downarrow
  2736.                         & \updownarrow & \\updownarrow \cr
  2737. \Updownarrow & \\Updownarrow \cr
  2738.        }
  2739.  
  2740. \toindex{lfloor}
  2741. \toindex{rfloor}
  2742. \toindex{lceil}
  2743. \toindex{rceil}
  2744. \toindex{langle}
  2745. \toindex{rangle}
  2746. \toindex{|}
  2747. \toindex{uparrow}
  2748. \toindex{Uparrow}
  2749. \toindex{downarrow}
  2750. \toindex{Downarrow}
  2751. \toindex{updownarrow}
  2752. \toindex{Updownarrow}
  2753.  
  2754. \exercise Typeset $\bigl \lceil \lfloor x \rfloor \bigr \rceil
  2755.               \leq \bigl \lfloor \lceil x \rceil \bigr \rfloor$.
  2756.  
  2757. \subsection{Those special functions}
  2758.  
  2759. There are several types of functions that appear frequently in
  2760. mathematical text.  In an equation like ``$\sin^2x + \cos^2x =
  2761. 1$'' the trigonometric functions ``sin'' and ``cos'' are in roman
  2762. rather than italic type. This is the usual mathematical
  2763. convention to indicate that it is a function being described and
  2764. not the product of three variables.  The control words {\tt
  2765. \\sin} and {\tt \\cos} will use the right typeface automatically.
  2766. Here is a table of these and some other special functions:
  2767. \TeXref{162}
  2768.  
  2769. \maketable [Special mathematical functions]
  2770. \halign{
  2771.    \strut \tt {\\}#\hfil && \quad \tt {\\}#\hfil \cr
  2772.    \noalign{\hrule} \noalign{\smallskip}
  2773.    sin    & cos    & tan  & cot  & sec  & csc & arcsin & arccos \cr
  2774.    arctan & sinh   & cosh & tanh & coth & lim & sup    & inf    \cr
  2775.    limsup & liminf & log  & ln   & lg   & exp & det    & deg    \cr
  2776.    dim    & hom    & ker  & max  & min  & arg & gcd    & Pr     \cr
  2777.        }
  2778.  
  2779. \toindex{sin}
  2780. \toindex{cos}
  2781. \toindex{tan}
  2782. \toindex{cot}
  2783. \toindex{sec}
  2784. \toindex{csc}
  2785. \toindex{arcsin}
  2786. \toindex{arccos}
  2787. \toindex{arctan}
  2788. \toindex{sinh}
  2789. \toindex{cosh}
  2790. \toindex{tanh}
  2791. \toindex{coth}
  2792. \toindex{lim}
  2793. \toindex{sup}
  2794. \toindex{inf}
  2795. \toindex{limsup}
  2796. \toindex{liminf}
  2797. \toindex{log}
  2798. \toindex{ln}
  2799. \toindex{lg}
  2800. \toindex{exp}
  2801. \toindex{det}
  2802. \toindex{deg}
  2803. \toindex{dim}
  2804. \toindex{hom}
  2805. \toindex{ker}
  2806. \toindex{max}
  2807. \toindex{min}
  2808. \toindex{arg}
  2809. \toindex{gcd}
  2810. \toindex{Pr}
  2811.  
  2812. \exercise Typeset: $\sin(2\theta) = 2\sin\theta\cos\theta \quad
  2813. \cos(2\theta) = 2\cos^2\theta - 1  $.
  2814.  
  2815. \exercise Typeset: $$\int \csc^2x\, dx = -\cot x+ C
  2816. \qquad \lim_{\alpha\to 0} {\sin\alpha \over \alpha} = 1
  2817. \qquad \lim_{\alpha\to \infty} {\sin\alpha \over \alpha} = 0.$$
  2818.  
  2819. \exercise Typeset: $$\tan(2\theta) = {2\tan\theta \over
  2820. 1-\tan^2\theta}.$$
  2821.  
  2822.  
  2823. \subsection{Hear ye, hear ye!}
  2824.  
  2825. There is a particular macro that is used in almost every
  2826. mathematical paper, and is different enough to require a special
  2827. explanation. This is the {\tt \\proclaim} macro.  It is used when
  2828. stating theorems, corollaries, propositions, and the like.  The
  2829. paragraph following {\tt \\proclaim} is broken into two parts:
  2830. the first part goes up to and including the first period that is
  2831. followed by a space, and the second part is the rest of the
  2832. paragraph. \TeXref{202--203}The idea is that the first part
  2833. should be something like ``Theorem 1.'' or ``Corollary B.'' The
  2834. second part is the statement of the theorem or corollary.  Here
  2835. is an example:
  2836. \toindex{proclaim}
  2837.  
  2838. \beginliteral
  2839. \proclaim Theorem 1 (H.~G.~Wells). In the country of the blind,
  2840. the one-eyed man is king.
  2841. @endliteral
  2842.  
  2843. \noindent gives
  2844.  
  2845. \proclaim Theorem 1 (H.~G.~Wells). In the country of the blind,
  2846. the one-eyed man is king.
  2847.  
  2848. The statement of the theorem may contain mathematical expressions, of
  2849. course.
  2850.  
  2851. \vfill\eject
  2852. \exercise Typeset:
  2853. \nobreak
  2854. \proclaim Theorem (Euclid). There exist an infinite number of
  2855. primes.
  2856.  
  2857. \exercise Typeset:
  2858. \proclaim Proposition 1.
  2859. $\root n \of {\prod_{i=1}^n X_i} \leq {1 \over n} \sum_{i=1}^n X_i$
  2860. with equality if and only if $X_1=\cdots=X_n$.
  2861.  
  2862. \subsection{Matrices}
  2863.  
  2864. Matrices are typeset using combinations of the alignment
  2865. character {\tt \&} and the control word {\tt \\cr} to indicate
  2866. the end of the line.  Start with {\tt \$\$\\pmatrix\lb$\dots$\rb\$\$}.
  2867. Into the space between the braces go the rows of the matrix, each
  2868. one ended by {\tt \\cr}.  The entries are separated by the
  2869. {\tt \&}\null.  For example the input
  2870. \TeXref{176--178}
  2871.  
  2872. \beginliteral
  2873. $$\pmatrix{
  2874. a & b & c & d \cr
  2875. b & a & c+d & c-d \cr
  2876. 0 & 0 & a+b & a-b \cr
  2877. 0 & 0 & ab  & cd \cr
  2878. }.$$
  2879. @endliteral
  2880.  
  2881. \noindent
  2882. gives as printed output
  2883. $$\pmatrix{
  2884. a & b & c & d \cr
  2885. b & a & c+d & c-d \cr
  2886. 0 & 0 & a+b & a-b \cr
  2887. 0 & 0 & ab  & cd \cr
  2888. }.$$
  2889. \toindex{pmatrix}
  2890.  
  2891. The matrix entries in our examples have all been \centred{}
  2892. within their columns with a little space on each side.  They can
  2893. be made flush right or flush left by inserting {\tt \\hfill}
  2894. before or after the entry. Notice the differences between the
  2895. following example and the previous one.
  2896.  
  2897. \beginliteral
  2898. $$\pmatrix{
  2899. a & b & c \hfill  & \hfill d  \cr
  2900. b & a & c+d      & c-d      \cr
  2901. 0 & 0 & a+b      & a-b      \cr
  2902. 0 & 0 & ab \hfill & \hfill cd \cr
  2903. }.$$
  2904. @endliteral
  2905.  
  2906. \noindent
  2907. gives as printed output
  2908.  
  2909. $$\pmatrix{
  2910. a & b & c \hfill & \hfill d   \cr
  2911. b & a & c+d     & c-d       \cr
  2912. 0 & 0 & a+b     & a-b       \cr
  2913. 0 & 0 & ab \hfill & \hfill cd \cr
  2914. }.$$
  2915.  
  2916.  
  2917. \vbox{
  2918. \exercise Typeset
  2919. $$ I_4 = \pmatrix{ 1 &0 &0 &0 \cr
  2920.                    0 &1 &0 &0 \cr
  2921.                    0 &0 &1 &0 \cr
  2922.                    0 &0 &0 &1 \cr}$$
  2923. }
  2924.  
  2925. It's possible to have matrices that use other delimiters. Using
  2926. {\tt \\matrix} instead of {\tt \\pmatrix} will leave off the
  2927. parentheses, so the delimiters must be explicitly included using
  2928. {\tt \\left} and {\tt \\right}.  Here is how we can change the
  2929. matrix of our first example.
  2930. \toindex{matrix}
  2931. \toindex{left}
  2932. \toindex{right}
  2933.  
  2934. \beginliteral
  2935. $$ \left |
  2936. \matrix{
  2937. a & b & c & d \cr
  2938. b & a & c+d & c-d \cr
  2939. 0 & 0 & a+b & a-b \cr
  2940. 0 & 0 & ab  & cd \cr
  2941. }
  2942. \right | $$
  2943. @endliteral
  2944.  
  2945. \noindent
  2946. gives as printed output
  2947. $$ \left |
  2948. \matrix{
  2949. a & b & c & d \cr
  2950. b & a & c+d & c-d \cr
  2951. 0 & 0 & a+b & a-b \cr
  2952. 0 & 0 & ab  & cd \cr
  2953. }
  2954. \right | $$
  2955.  
  2956. It's even possible to use {\tt \\left.} and {\tt \\right.} to
  2957. indicate that the opening or closing delimiter is deleted (note
  2958. the use of the period).
  2959.  
  2960. \exercise Use a matrix construction to typeset
  2961.  
  2962. $$ |x| = \left\{ \matrix{ x & x \ge 0 \cr
  2963.                          -x & x \le 0 \cr} \right.$$
  2964.  
  2965. This exercise and more general constructions of this type
  2966. may also be typeset using the {\tt \\cases} macro.
  2967. \TeXref{175}
  2968.  
  2969. Sometimes ellipses are used within matrices.  The control words
  2970. {\tt \\cdots}, {\tt \\vdots}, and {\tt \\ddots} can be used to
  2971. insert horizontal, vertical, and diagonal dots.
  2972.  
  2973. Thus we can use
  2974. \beginliteral
  2975. $$ \left [
  2976. \matrix{
  2977. aa     & \cdots & az     \cr
  2978. \vdots & \ddots & \vdots \cr
  2979. za     & \cdots & zz     \cr
  2980. }
  2981. \right ] $$
  2982. @endliteral
  2983.  
  2984. \noindent
  2985. to get as printed output
  2986. $$ \left [
  2987. \matrix{
  2988. aa     & \cdots & az     \cr
  2989. \vdots & \ddots & \vdots \cr
  2990. za     & \cdots & zz     \cr
  2991. }
  2992. \right ] $$
  2993.  
  2994.  
  2995. Matrices may also be typeset in-line, but they are pretty ugly
  2996. unless they have a small number of rows.
  2997.  
  2998.  
  2999. \subsection{Displayed equations}
  3000.  
  3001. All of the mathematics covered so far has identical input whether
  3002. it is to be typeset in-line or displayed.  At this point we'll
  3003. look at some situations that apply to displayed equations only.
  3004.  
  3005. The first is that of aligning multiline displays.  This is done with
  3006. the alignment character {\tt \&} and the control words {\tt \\cr} and
  3007. {\tt \\eqalign}. Starting with {\tt \$\$\\eqalign\lb$\dots$\rb\$\$},
  3008. the equations to be aligned are entered with each one terminated by
  3009. {\tt \\cr}.  In each equation there should be one alignment symbol
  3010. {\tt \&} to indicate where the alignment should take place.  This is
  3011. usually done at the equal signs, although it is not necessary to do
  3012. so.  For example
  3013. \TeXref{190--192}
  3014. \toindex{eqalign}
  3015.  
  3016. \beginliteral
  3017. $$\eqalign{
  3018. a+b &= c+d \cr
  3019. x &= w + y + z \cr
  3020. m + n + o + p &= q \cr
  3021. }$$
  3022. @endliteral
  3023.  
  3024.  
  3025. \noindent
  3026. yields
  3027. $$\eqalign{
  3028. a+b &= c+d \cr
  3029. x &= w + y + z \cr
  3030. m + n + o + p &= q \cr
  3031. }$$
  3032.  
  3033. Displayed equations can be numbered at either the right or left
  3034. margin.  When the control word {\tt \\eqno} appears in a displayed
  3035. equation, everything after the control word is put at the right
  3036. margin.  Hence {\tt \$\$ x+y=z. \\eqno (1)\$\$} yields
  3037. $$ x+y=z. \eqno (1)$$
  3038. To number an equation at the left margin, use {\tt \\leqno}
  3039. in place of {\tt \\eqno}.
  3040. \toindex{eqno}
  3041. \toindex{leqno}
  3042.  
  3043. It's possible to number aligned equations by using the control
  3044. word {\tt \\eqalignno}.  The alignment character {\tt \&} is
  3045. used to separate the equation from the equation number.
  3046. \beginliteral
  3047. $$\eqalignno{
  3048. a+b &= c+d & (1) \cr
  3049. x &= w + y + z \cr
  3050. m + n + o + p &= q & * \cr
  3051. }$$
  3052. @endliteral
  3053.  
  3054. \noindent
  3055. yields
  3056. $$\eqalignno{
  3057. a+b &= c+d & (1) \cr
  3058. x &= w + y + z \cr
  3059. m + n + o + p &= q & * \cr
  3060. }$$
  3061.  
  3062. Use {\tt \\leqalignno} to put the equation numbers on the left.
  3063. \TeXref{192--193}
  3064. \toindex{eqalignno}
  3065. \toindex{leqalignno}
  3066.  
  3067. Finally, suppose some text needs to appear in the middle of a
  3068. displayed equation.  This can be done by putting it in an hbox.
  3069. We will describe hboxes in more detail in the next section.
  3070. For now we want to use them to temporarily resume using ordinary
  3071. roman type and to also allow the insertion of space between
  3072. words (remember that all spaces are ignored when typesetting
  3073. mathematics). Hence
  3074. {\tt \$\$X=Y \\hbox\lb{} if and only if \rb x=y.\$\$} will give
  3075. $$X=Y \hbox{ if and only if } x=y.$$
  3076. Note carefully the spaces in the hbox.
  3077.  
  3078. \exercise Do some of the challenge problems on pages 180--181 of The
  3079. \TeX book.
  3080.  
  3081.  
  3082.  
  3083.  
  3084. \section{All in a row}
  3085.  
  3086. It's not uncommon to want to put a table in the middle of some
  3087. text. Fortunately \TeX{} makes it easy to do this.  In fact there
  3088. are two separate methods of aligning text.  The first is by using
  3089. the tabbing environment.  This is similar to setting the tab
  3090. stops on a typewriter. Each line is handled individually,
  3091. according to set tab columns, but with greater flexibility than
  3092. that provided by a typewriter. The second is the horizontal
  3093. alignment environment which typesets the whole table at once
  3094. using a prescribed pattern.
  3095.  
  3096. \subsection{Picking up the tab}
  3097.  
  3098. To align material using the tabbing environment, you must first
  3099. set the tab positions using the {\tt \\settabs} control word.
  3100. Having done this, a line to use these tabs starts with the
  3101. control symbol {\tt \\+ } and ends with {\tt \\cr } (remember
  3102. that the actual spacing on lines in the input file in
  3103. unimportant). \toindex{settabs}
  3104.  
  3105. The easiest way to use the {\tt \\settabs} control word is to put
  3106. the text into equal columns.
  3107. \TeXref{231}
  3108. Using {\tt \\settabs 4 \\columns} will set the tabs that will
  3109. produce four equal columns.  The tabbing is then done by using
  3110. the alignment character {\tt \&} to move to the next tab stop.
  3111. So, for example, \toindex{columns}
  3112.  
  3113. \beginliteral
  3114. \settabs 4 \columns
  3115. \+ British Columbia & Alberta & Saskatchewan & Manitoba \cr
  3116. \+ Ontario & Quebec & New Brunswick & Nova Scotia \cr
  3117. \+ & Prince Edward Island & Newfoundland \cr
  3118. @endliteral
  3119.  
  3120.  
  3121. \noindent
  3122. will produce the table
  3123. \vskip\baselineskip
  3124.  
  3125. \settabs 4 \columns
  3126. \+ British Columbia & Alberta & Saskatchewan & Manitoba \cr
  3127. \+ Ontario & Quebec & New Brunswick & Nova Scotia \cr
  3128. \+ & Prince Edward Island & Newfoundland \cr
  3129.  
  3130. Notice that it is possible to skip over some tab positions, and
  3131. it is not necessary to use all of the tabs in a given line. To
  3132. make the same table using five columns, it is only necessary to
  3133. use {\tt \\settabs 5 \\columns} to reset the tab stops; then the
  3134. same three lines from the last example will produce:
  3135. \vskip\baselineskip
  3136.  
  3137. \settabs 5 \columns
  3138. \+ British Columbia & Alberta & Saskatchewan & Manitoba \cr
  3139. \+ Ontario & Quebec & New Brunswick & Nova Scotia \cr
  3140. \+ & Prince Edward Island & Newfoundland \cr
  3141.  
  3142. In this example, the columns are smaller, of course.  In fact
  3143. there are two overlapping entries in the last row.  This is
  3144. because \TeX{} will tab to the next tab position even if (unlike
  3145. a typewriter) it means going backward on the page.
  3146.  
  3147. There is an interesting relationship between grouping and
  3148. tabbing. The {\tt \\settabs} values are only applicable to the
  3149. group in which it is defined, as would be expected.  Thus it is
  3150. possible to temporarily change the tab settings by grouping
  3151. within braces.  In addition, each table entry is in a group of
  3152. its own. Hence we may make a single entry boldface, for example,
  3153. by using {\tt \\bf}  without braces. In addition, for any column
  3154. but the last one it is possible to \centre{} the entry or to
  3155. align it either on the left or on the right, or to fill a column
  3156. with a line or dots. Each entry has an implicit {\tt \\hfil} at
  3157. the end so that it will be at the left of the column by default.
  3158. Adding {\tt \\hfil} at the beginning of the entry will then cause
  3159. it to be \centred{}, just as with the {\tt \\line} control word.
  3160. Adding {\tt \\hfill} to the beginning will cause the entries to
  3161. be pushed to the right ({\tt \\hfill} acts just like {\tt \\hfil}
  3162. in that it absorbs excess space; when both {\tt \\hfil} and {\tt
  3163. \\hfill} appear, the {\tt \\hfill} takes precedence).
  3164. \toindex{hfill}
  3165.  
  3166. \beginliteral
  3167. \settabs 4 \columns
  3168. \+ \hfil British Columbia & \hfill Alberta \qquad & \bf Saskatchewan
  3169. @hskip 2.5in                                  & Manitoba \cr
  3170. \+ \hfil Ontario & \hfill Quebec \qquad & \bf New Brunswick
  3171. @hskip 2.5in                                 & Nova Scotia \cr
  3172. \+ \hfil ---  & \hfill * \qquad & \bf Newfoundland
  3173. @hskip 2.5in          & Prince Edward Island \cr
  3174. \+ \dotfill && \hrulefill & \cr
  3175. @endliteral
  3176.  
  3177. \noindent
  3178. will produce a table with the first column \centred{}, the second
  3179. column flush right with a {\tt \\qquad} of padding, and the third
  3180. column boldface. The control words {\tt \\dotfill} and {\tt \\hrulefill}
  3181. give alternative column entries.
  3182. \toindex{dotfill}
  3183. \toindex{hrulefill}
  3184. \vskip\baselineskip
  3185.  
  3186. \settabs 4 \columns
  3187. \+ \hfil British Columbia & \hfill Alberta \qquad & \bf Saskatchewan
  3188.                                         & Manitoba \cr
  3189. \+ \hfil Ontario & \hfill Quebec \qquad & \bf New Brunswick
  3190.                                         & Nova Scotia \cr
  3191. \+ \hfil ---  & \hfill * \qquad & \bf Newfoundland &
  3192.                       Prince Edward Island \cr
  3193. \+ \dotfill && \hrulefill & \cr
  3194.  
  3195. \exercise Take the table of Canadian provinces above and \centre{} each
  3196. entry within its column.
  3197.  
  3198. The tab positions can be set with much more flexibility than just
  3199. in equal columns.  The general pattern is to use a sample line of
  3200. the form {\tt \\settabs \\+ $\ldots$ \& $\ldots$ \& $\ldots$ \\cr}.
  3201. The spacing between the alignment characters {\tt \&}
  3202. determines the position of the tabs.  For example, {\tt \\settabs
  3203. \\+ \\hskip 1 in \& \\hskip 2 in \& \\hskip 1.5 in \& \\cr} would
  3204. set the first tab one inch from the left margin, the next another
  3205. two inches further in, and the third 1.5 inches more.  It's also
  3206. possible to use text to determine the distance between tabs. So,
  3207. for example, another possible sample line is
  3208. {\tt \\settabs \\+ \\quad Province \\quad \& \\quad Population \\quad
  3209. \& \\quad Area \\quad \& \\cr}.
  3210. The tab column would then be just wide enough to accept the headings
  3211. with a quad of space on each side.  Here's a more complete example:
  3212.  
  3213. \beginuser \obeyspaces
  3214. \\settabs \\+ \\quad Year \\quad \& \\quad Price \\quad
  3215.                                             \& \\quad Dividend \& \\cr
  3216. \\+ \\hfill Year \\quad \& \\quad Price  \\quad \& \\quad Dividend \\cr
  3217. \\+ \\hfill 1971 \\quad \& \\quad 41--54 \\quad \& \\qquad \$2.60   \\cr
  3218. \\+ \\hfill 2    \\quad \& \\quad 41--54 \\quad \& \\qquad \$2.70 \\cr
  3219. \\+ \\hfill 3    \\quad \& \\quad 46--55 \\quad \& \\qquad \$2.87 \\cr
  3220. \\+ \\hfill 4    \\quad \& \\quad 40--53 \\quad \& \\qquad \$3.24 \\cr
  3221. \\+ \\hfill 5    \\quad \& \\quad 45--52 \\quad \& \\qquad \$3.40 \\cr
  3222. \enduser
  3223.  
  3224. \noindent
  3225. gives \TeXref{247}
  3226. \vskip\baselineskip
  3227.  
  3228. \settabs \+ \quad Year \quad & \quad Price \quad & \quad
  3229. Dividend \quad & \cr
  3230. \+ \hfill Year \quad & \quad Price  \quad & \quad Dividend \cr
  3231. \+ \hfill 1971 \quad & \quad 41--54 \quad & \qquad \$2.60   \cr
  3232. \+ \hfill 2    \quad & \quad 41--54 \quad & \qquad \$2.70 \cr
  3233. \+ \hfill 3    \quad & \quad 46--55 \quad & \qquad \$2.87 \cr
  3234. \+ \hfill 4    \quad & \quad 40--53 \quad & \qquad \$3.24 \cr
  3235. \+ \hfill 5    \quad & \quad 45--52 \quad & \qquad \$3.40 \cr
  3236.  
  3237. \exercise Take the table given above and move it closer to the
  3238. \centre{} of the page.
  3239.  
  3240. \exercise One way to \centre{} a block of text, possibly several
  3241. lines long, is to use: {\tt \$\$\\vbox\lb$\ldots$\rb\$\$}. Use
  3242. this to \centre{} the table given above.  Does the
  3243. {\tt \\settabs} line need to be included in the {\tt \\vbox}?
  3244.  
  3245. \exercise Improve your last result by putting a line under the
  3246. column heads.  The control word {\tt \\hrule} will insert a
  3247. horizontal line if introduced between two rows of a table.  Now
  3248. repeat with the control word {\tt \\strut} after the {\tt \\+ }
  3249. of the line containing the column heads. (A {\tt \\strut}
  3250. effectively makes the spacing between lines a little greater. The
  3251. size can be altered from the default.)\TeXref{82} Note the extra
  3252. space that results.
  3253. \toindex{strut}
  3254.  
  3255. \exercise Make the following table with decimal alignment, that
  3256. is, with the decimal points above each other (think of the dollar
  3257. figure as being right aligned and the cents figure as being left
  3258. aligned against the decimal point):
  3259. \medskip
  3260. \settabs \+ \hskip 2 in & \hskip .75in & \hskip 1cm& \cr
  3261. \+ &Plums &\hfill\$1&.22 \cr
  3262. \+ &Coffee &\hfill1&.78 \cr
  3263. \+ &Granola &\hfill1&.98 \cr
  3264. \+ &Mushrooms & &.63 \cr
  3265. \+ &{Kiwi fruit} & &.39 \cr
  3266. \+ &{Orange juice} &\hfill1&.09 \cr
  3267. \+ &Tuna &\hfill1&.29 \cr
  3268. \+ &Zucchini & &.64 \cr
  3269. \+ &Grapes &\hfill1&.69 \cr
  3270. \+ &{Smoked beef} & &.75 \cr
  3271. \+ &Broccoli &\hfill\underbar{\ \ 1}&\underbar{.09} \cr
  3272. \+ &Total &\hfill \$12&.55 \cr
  3273.  
  3274.  
  3275. \exercise Devise a method to make a rough table of contents by using
  3276. {\tt settabs} and having entries looking something like:\hfil\break
  3277. \leftline{\tt Getting Started \\dotfill \& \\hfill 1}
  3278. \leftline{\tt All Characters Great and Small \\dotfill \& \\hfill 9.}
  3279.  
  3280. \subsection{Horizontal alignment with more sophisticated patterns}
  3281.  
  3282. The {\tt \\settabs} environment is not difficult to use, and once
  3283. the pattern is set, it can be used repeatedly in different
  3284. portions of the text that follows.  It does have some drawbacks,
  3285. however. For one, the column size must be set before the entries
  3286. are known. Also, even though in one case we wanted the third
  3287. column to be boldface, it had to be specified in each line.
  3288. These problems can be handled more easily by using the {\tt
  3289. \\halign} environment.
  3290. \TeXref{235--238}
  3291. \toindex{halign}
  3292.  
  3293.  
  3294. The general pattern in the {\tt \\halign} is as follows:
  3295. \beginuser
  3296. \\halign\lb{} <template line> \\cr
  3297. <first display line> \\cr
  3298. <second display line> \\cr
  3299. $\vdots$
  3300. <last display line> \\cr
  3301. \rb
  3302. \enduser
  3303.  
  3304. Both the template line and the display lines are divided into
  3305. sections by the alignment symbol {\tt \&}\null. In the template
  3306. line each section uses control words in the same manner as does
  3307. {\tt \\line\lb\rb}\null.  The control word {\tt \\hfil}, for
  3308. example, can be used to display flush left, flush right, or \centred.
  3309. Fonts can be changed using {\tt \\bf}, {\tt \\it}, etc.
  3310. Text may also be entered in the template line.  In addition the
  3311. special symbol {\tt \#} must appear once in each section.  Each
  3312. display line is then set by substituting each section of the
  3313. display line into its corresponding section of the template line
  3314. at the occurrence of the {\tt \#}\null.
  3315.  
  3316. Consider the following example:
  3317.  
  3318. \beginuser
  3319. \\halign\lb\\hskip 2 in \$\#\$\& \\hfil \\quad \# \\hfil \& \\qquad \$\#\$
  3320.        \hskip 3in \& \\hfil \\quad \# \\hfil \\cr
  3321. \\alpha   \& alpha   \& \\beta  \& beta  \\cr
  3322. \\gamma   \& gamma   \& \\delta \& delta \\cr
  3323. \\epsilon \& epsilon \& \\zeta  \& zeta  \\cr
  3324. \rb
  3325. \enduser
  3326.  
  3327. \noindent The template line indicates that the first section of
  3328. the typeset text will always be set two inches in from the left
  3329. and also be set as mathematics.  The second section will be \centred{}
  3330. after adding a quad of space on the left.  The third
  3331. and fourth sections are handled similarly.  Here is the result:
  3332. \vskip\baselineskip
  3333.  
  3334. \halign{\hskip 2in $#$& \hfil\quad # \hfil & \qquad $#$
  3335.                        & \hfil\quad # \hfil\cr
  3336. \alpha   & alpha   & \beta  & beta \cr
  3337. \gamma   & gamma   & \delta & delta \cr
  3338. \epsilon & epsilon & \zeta  & zeta \cr
  3339. }
  3340.  
  3341. In this case the first display line is formed by substituting {\tt
  3342. \\alpha} for the first {\tt \#} in the template line, {\tt alpha} for
  3343. the second {\tt \#}, {\tt \\beta} for the third and {\tt beta} for
  3344. the fourth.  The whole line is then saved for setting.  This
  3345. continues until all the lines are accumulated, and then they are set
  3346. with each column being as wide as necessary to accept all of its
  3347. entries (an implication of this accumulation process is that a table
  3348. with too many entries could cause \TeX{} to run out of memory; it's
  3349. better not to set tables that are more than a page or so long).
  3350.  
  3351. Hence the template line establishes the pattern for the table entries
  3352. and the display lines insert the individual entries.
  3353.  
  3354. Sometimes horizontal and vertical lines are used to delimit
  3355. entries in a table.  To put in horizontal lines, we use {\tt \\hrule},
  3356. just as we did in the {\tt \\settabs} environment.
  3357. However, we don't want the rule to be aligned according to the
  3358. template, so we use the control word {\tt \\noalign}.  Hence
  3359. horizontal lines are inserted by putting {\tt \\noalign\lb\\hrule\rb};
  3360. vertical lines are inserted by putting {\tt \\vrule}
  3361. in either the template or the display line. But still all is not
  3362. completely straightforward.  Suppose we take our last example and
  3363. change the template to get vertical lines and also insert
  3364. horizontal lines.
  3365. \toindex{noalign}
  3366.  
  3367. \beginuser
  3368. \\halign\lb\\hskip 2in\\vrule\\quad \$\#\$\\quad \& \\vrule \\hfil\\quad %
  3369. \# \\hfil
  3370. \hskip 2 in \& \\quad \\vrule \\quad \$\#\$\\quad
  3371. \hskip 2 in \& \\vrule\\hfil \\quad \# \\quad \\hfil \\vrule \\cr
  3372. \\noalign\lb\\hrule\rb
  3373. \\alpha   \& alpha   \& \\beta  \& beta \\cr
  3374. \\noalign\lb\\hrule\rb
  3375. \\gamma   \& gamma   \& \\delta \& delta \\cr
  3376. \\noalign\lb\\hrule\rb
  3377. \\epsilon \& epsilon \& \\zeta  \& zeta \\cr
  3378. \\noalign\lb\\hrule\rb
  3379. \rb
  3380. \enduser
  3381.  
  3382. \noindent
  3383. doesn't give exactly what we want.
  3384.  
  3385. \vskip\baselineskip
  3386.  
  3387. \halign{\hskip 2in\vrule\quad $#$\quad & \vrule \hfil\quad # \hfil
  3388. & \quad \vrule \quad $#$\quad & \vrule \hfil\quad # \quad \hfil
  3389. \vrule \cr
  3390. \noalign{\hrule}
  3391. \alpha   & alpha   & \beta  & beta \cr
  3392. \noalign{\hrule}
  3393. \gamma   & gamma   & \delta & delta \cr
  3394. \noalign{\hrule}
  3395. \epsilon & epsilon & \zeta  & zeta \cr
  3396. \noalign{\hrule}
  3397. }
  3398.  
  3399. There are several deficiencies: the most obvious is the extended
  3400. horizontal lines, but also the text looks somewhat squashed into
  3401. the boxes.  In addition, the text has a little extra space on the
  3402. right rather than being perfectly \centred. As in the {\tt \\settabs}
  3403. environment, lines can be made taller by including the control
  3404. word {\tt \\strut} in the template.\TeXref{82} A further problem
  3405. can occur when the page is set since \TeX{} may spread lines
  3406. apart slightly to improve the appearance of the page.  This would
  3407. leave a gap between the vertical lines, so we use the control
  3408. word {\tt \\offinterlineskip} within the {\tt \\halign} to avoid
  3409. this.  Finally we can get rid of the lines sticking out on the
  3410. left by deleting the {\tt \\hskip 2 in} from the template line.
  3411. To move the table to the same position we use {\tt \\moveright}.
  3412. Finally, we can see how to \centre{} the text by noting that the
  3413. extra space occurs in the template line after the {\tt \#} where
  3414. the text is inserted.
  3415. Hence we can improve our result by using
  3416. \toindex{offinterlineskip}
  3417. \toindex{moveright}
  3418.  
  3419. \beginuser
  3420. \\moveright 2 in
  3421. \\vbox\lb\\offinterlineskip
  3422.  
  3423. \\halign\lb\\strut \\vrule \\quad \$\#\$\\quad \&\\vrule \\hfil \\quad %
  3424. \#\\quad \\hfil
  3425. \&\\vrule \\quad \$\#\$\\quad \&\\vrule \\hfil \\quad \#\\quad \\hfil %
  3426. \\vrule \\cr
  3427. \\noalign\lb\\hrule\rb
  3428. \\alpha   \& alpha   \& \\beta  \& beta \\cr
  3429. \\noalign\lb\\hrule\rb
  3430. \\gamma   \& gamma   \& \\delta \& delta \\cr
  3431. \\noalign\lb\\hrule\rb
  3432. \\epsilon \& epsilon \& \\zeta  \& zeta \\cr
  3433. \\noalign\lb\\hrule\rb
  3434. \rb\rb
  3435. \enduser
  3436.  
  3437. \noindent
  3438. to get
  3439. \vskip\baselineskip
  3440.  
  3441. \moveright 2 in
  3442. \vbox{\offinterlineskip
  3443. \halign{\strut \vrule \quad $#$\quad &\vrule \hfil \quad #\quad \hfil
  3444. &\vrule \quad $#$\quad &\vrule \hfil \quad #\quad \hfil
  3445. \vrule \cr
  3446. \noalign{\hrule}
  3447. \alpha   & alpha   & \beta  & beta \cr
  3448. \noalign{\hrule}
  3449. \gamma   & gamma   & \delta & delta \cr
  3450. \noalign{\hrule}
  3451. \epsilon & epsilon & \zeta  & zeta \cr
  3452. \noalign{\hrule}
  3453. }
  3454. }
  3455.  
  3456.  
  3457.  
  3458. In general, if we want to construct a table with boxed entries
  3459. that is \centred{} on the page, we can do so by putting the {\tt
  3460. \\vbox} within a {\tt \\centerline\lb\rb}\null. But here is a
  3461. trick that will produce a nicer result.  If the {\tt \\vbox} is
  3462. put in between double dollar signs, it will be typeset as
  3463. displayed mathematics.  Of course, there is no actual
  3464. mathematics being displayed, but \TeX{} will put in a little
  3465. extra space above and below the table as is appropriate for a
  3466. display.  Hence a \centred{} table with this nice spacing may be
  3467. formed using the following four steps:
  3468. (1) put a {\tt \\vbox} between double dollar signs,
  3469. (2) put an {\tt \\offinterlineskip} and an {\tt \\halign} within
  3470. the {\tt \\vbox},
  3471. (3) in the {\tt \\halign} put a template line with a {\tt \\strut}
  3472. in the beginning,  and a {\tt \\vrule} surrounding each entry,
  3473. (4) each row of the table should be preceded and followed by
  3474. {\tt \\noalign\lb\\hrule\rb}.
  3475.  
  3476. Here is the pattern to be followed:
  3477.  
  3478. \beginuser
  3479. \$\$\\vbox\lb
  3480. \\offinterlineskip
  3481. \\halign\lb
  3482. \\strut \\vrule \# \& \\vrule \# \& \dots \& \\vrule \# \\vrule \\cr
  3483. \\noalign\lb\\hrule\rb
  3484. <first column entry> \& <second column entry> \& \dots %
  3485. \& <last column entry> \\cr
  3486. \\noalign\lb\\hrule\rb
  3487. \dots
  3488. \\noalign\lb\\hrule\rb
  3489. <first column entry> \& <second column entry> \& \dots %
  3490. \& <last column entry> \\cr
  3491. \\noalign\lb\\hrule\rb
  3492. \rb
  3493. \rb\$\$
  3494. \enduser
  3495.  
  3496.  
  3497.  
  3498. \section{Rolling your own}
  3499.  
  3500. In this section we'll create new control words.  The making of
  3501. these new definitions, also called macros, is one of the most
  3502. powerful techniques available in \TeX\null.  For the first
  3503. application of this facility, we'll see how a new definition can
  3504. save a lot of typing by substituting short strings for long ones.
  3505.  
  3506. \subsection{The long and short of it}
  3507.  
  3508. The control word {\tt \\def} is used to define new control words.
  3509. The simplest form for doing this is {\tt \\def\\newname\lb$\ldots$\rb}.
  3510. Then whenever {\tt \\newname} appears in your
  3511. input file, it will be replaced by whatever is between the braces
  3512. in the definition.  Of course {\tt \\newname} must satisfy the
  3513. convention for naming control sequences, that is, it must be a
  3514. control word (all letters) or a control symbol (exactly one
  3515. nonletter). So, for example, suppose you write a document that
  3516. contains the phrase ``University of Manitoba'' many times.  Then
  3517. {\tt \\def\\um\lb University of Manitoba\rb} defines a new
  3518. control sequence {\tt \\um} which can then be used at any time.
  3519. The sentence {\tt I take courses at the \\um.}\ then makes
  3520. sense. If the control word exists, your new definition will
  3521. replace it (this includes the control words defined by \TeX{}, so
  3522. a little care must be taken in the choice of name). Any
  3523. definition is, however,  local to the group in which it is
  3524. defined.  For example, \toindex{def}
  3525.  
  3526. \beginuser
  3527. \\def\\um\lb University of Manitoba\rb
  3528. I took my first course at the \\um.
  3529. \lb
  3530. \\def\\um\lb Universit\\'e de Montr\\'eal\rb
  3531. Then I took my next course at the \\um.
  3532. \rb
  3533. Finally I took my last course at the \\um.
  3534. \enduser
  3535.  
  3536. \noindent gives \medskip
  3537.  
  3538. \def\um{University of Manitoba}
  3539. I took my first course at the \um.
  3540. {
  3541. \def\um{Universit\'e de Montr\'eal}
  3542. Then I took my next course at the \um.
  3543. }
  3544. Finally I took my last course at the \um.
  3545.  
  3546. Remember that all spaces after a control word are absorbed; this
  3547. includes the control words that you define. In the previous
  3548. example, any space after {\tt \\um} would be ignored. However,
  3549. the space after the first period and the space after the first
  3550. opening brace are different; if you look closely at the end of
  3551. the first sentence typeset using the example, you'll see some
  3552. extra space. This can be eliminated by putting a {\tt \%} after
  3553. the opening brace to make the rest of the line a comment. The
  3554. same holds for the line with the last closing brace. Careful
  3555. control of spaces often calls for the ``commenting out'' of the
  3556. end of lines in this manner.
  3557.  
  3558. Once a new control sequence has been defined, it may be used in
  3559. new definitions. This is one way of making simple form letters.
  3560. First let's define a simple letter.
  3561.  
  3562. \beginuser
  3563. \\def\\letter\lb
  3564. \\par \\noindent
  3565. Dear \\name,
  3566. \
  3567. This is a little note to let you know that your name is \\name.
  3568. \
  3569. \\hskip 2 in Sincerely yours,
  3570. \\vskip 2\\baselineskip
  3571. \\hskip 2 in The NameNoter
  3572. \\smallskip \\hrule
  3573. \rb
  3574. \enduser
  3575.  
  3576. \def\letter{
  3577. \par \noindent
  3578. Dear \name,
  3579.  
  3580. This is a little note to let you know that your name is \name.
  3581.  
  3582. \hskip 2 in Sincerely yours,
  3583. \vskip 2\baselineskip\nobreak
  3584. \hskip 2 in The NameNoter
  3585. \smallskip \hrule
  3586. }
  3587.  
  3588. Now this letter uses the control word {\tt \\name}, which is
  3589. undefined at this point.  When {\tt \\letter} is used, the
  3590. current value of {\tt \\name} will appear in the body of the
  3591. letter. Hence
  3592.  
  3593. \beginuser
  3594. \\def\\name\lb Michael Bishop\rb
  3595. \\letter
  3596. \\def\\name\lb Michelle L\\'ev\\\^{}eque\rb
  3597. \\letter
  3598. \enduser
  3599.  
  3600. \noindent will produce two copies of the letter, each with the
  3601. correct name, followed by a horizontal rule:
  3602.  
  3603. \def\name{Michael Bishop}
  3604. \letter
  3605. \goodbreak
  3606. \def\name{Michelle L\'ev\^eque}
  3607. \letter
  3608.  
  3609. We could have put anything between the braces in
  3610. {\tt \\def\\name\lb$\ldots$\rb}; it could be several paragraphs
  3611. long and use other control sequences (although in this context it
  3612. would be a little strange). Of course it is possible to use {\tt
  3613. \\vfill \\eject} as part of the definition of {\tt \\letter} to
  3614. eject the page when the letter is completed.
  3615.  
  3616. \exercise Make a form letter that uses the control words {\tt \\name},
  3617. {\tt \\address}, {\tt \\city}, {\tt \\\province}, and {\tt
  3618. \\\postcode}.
  3619.  
  3620. \exercise An unnumbered list of items is often made
  3621. using {\tt \\item\lb\$\\bullet\$\rb}.  Define a macro {\tt \\bitem}
  3622. that does this, and use it for several paragraphs. Now change
  3623. each bullet to a dash (note that a simple change in the macro
  3624. propagates all the necessary changes in all of the paragraphs).
  3625.  
  3626. \exercise Suppose that you are going to have to format several
  3627. paragraphs in a paper using {\tt \\hangindent = 30 pt}, {\tt \\hangafter
  3628. = 4}, and {\tt \\filbreak} (don't worry about what
  3629. these control sequences actually do; the only important thing
  3630. for now is that once they are set, they remain in effect for only
  3631. one paragraph).  Define a single control sequence {\tt \\setpar}
  3632. which can then be put in front of each paragraph that needs to be
  3633. so formatted.
  3634.  
  3635.  
  3636. \subsection{Filling in with parameters}
  3637.  
  3638. It's possible to use macros in much greater generality by
  3639. allowing parameters to be passed.  The idea is somewhat similar
  3640. to the template line in the {\tt \\halign} environment.  First,
  3641. let's look at the case where there is one parameter.  In this
  3642. case a control sequence is defined by {\tt \\def\\newword\#1\lb
  3643. $\ldots$\rb}\null.  The symbol {\tt \#1} may appear between the
  3644. braces (several times) in the definition of {\tt \\newword}.  The
  3645. material between the braces acts like a template. When {\tt
  3646. \\newword\lb$\ldots$\rb} appears in the text, it will use the
  3647. definition of {\tt \\newword} with the material between the
  3648. braces inserted into the template at every occurrence of {\tt
  3649. \#1} in the original definition. {\bf The spacing in the original
  3650. definition is crucial here; there must be no spaces before the
  3651. opening brace}.
  3652.  
  3653. As an example, we could use the form letter of the last section in
  3654. the following way:
  3655.  
  3656.  
  3657. \beginuser
  3658. \\def\\letter\#1\lb
  3659. \\par \\noindent
  3660. Dear \#1,
  3661. \vskip\baselineskip
  3662. This is a little note to let you know that your name is \#1.
  3663. \vskip\baselineskip
  3664. \\hskip 2 in Sincerely yours,
  3665. \\vskip 2\\baselineskip
  3666. \\hskip 2 in The NameNoter
  3667. \\smallskip \\hrule
  3668. \rb
  3669. \enduser
  3670.  
  3671. \def\letter#1{
  3672. \par \noindent
  3673. Dear #1,
  3674.  
  3675. This is a little note to let you know that your name is #1.
  3676.  
  3677. \hskip 2 in Sincerely yours,
  3678. \vskip 2\baselineskip
  3679. \hskip 2 in The NameNoter
  3680. \smallskip \hrule
  3681. }
  3682.  
  3683. Now we can use
  3684.  
  3685. \beginuser
  3686. \\letter\lb Michael Bishop\rb
  3687. \\letter\lb Michelle L\\'ev\\\^{}eque\rb
  3688. \enduser
  3689.  
  3690. \noindent to get \medskip
  3691. \letter{Michael Bishop}
  3692. \goodbreak
  3693. \letter{Michelle L\'ev\^eque}
  3694.  
  3695. \def\displaytext#1{$$\vbox{\hsize=12cm #1}$$}
  3696. \bigskip
  3697. \displaytext{
  3698. Now let's define
  3699. {\tt\\def\\displaytext\#1\lb \$\$\\vbox\lb\\hsize = 12 cm \#1\rb\$\$\rb}
  3700. as a new macro to display text.
  3701. Then {\tt \\displaytext\lb$\ldots$\rb} will cause the material
  3702. between the braces to be put in a paragraph with width 12 \centimetre
  3703. s and then \centred{} with some space added above and
  3704. below as is appropriate for a display.  This paragraph was set
  3705. using this {\tt \\displaytext} macro.
  3706. }
  3707.  
  3708. The parameter of a macro can be no more than one paragraph long.
  3709. If a new paragraph is encountered as part of a parameter, an
  3710. error will be generated.  This is a safety feature, for
  3711. otherwise the accidental omission of a closing brace would cause
  3712. \TeX{} to eat up the rest of the file as the parameter.
  3713.  
  3714. \exercise Define a macro {\tt \\yourgrade} so that {\tt
  3715. \\yourgrade\lb89\rb} will cause the following sentence to be
  3716. typeset: The grade you received is 89\%\null. It should be able
  3717. to work with any other percentage, of course.
  3718. \medbreak
  3719.  
  3720. It's not really any harder to use more than one parameter.  The form
  3721. used to define a new control word with two parameters is
  3722. {\tt \\def\\newword\#1\#2\lb$\ldots$\rb}. The definition between the
  3723. braces may have {\tt \#1} and {\tt \#2} occurring in it, perhaps
  3724. several times.  When {\tt \\newword\lb$\ldots$\rb\lb$\ldots$\rb}
  3725. appears in the text, the material between the first set of braces
  3726. replaces {\tt \#1} in the definition and the material between the
  3727. second set of braces replaces {\tt \#2} in the definition.  Here is
  3728. an example followed by its result:
  3729.  
  3730. \beginuser
  3731. \\def\\talks\#1\#2\lb \#1 talks to \#2.\rb
  3732. \\talks\lb John\rb\lb Jane\rb
  3733. \\talks\lb Jane\rb\lb John\rb
  3734. \\talks\lb John\rb\lb me\rb
  3735. \\talks\lb She\rb\lb Jane\rb
  3736. \enduser
  3737.  
  3738. \def\talks#1#2{#1 talks to #2.}
  3739. \talks{John}{Jane}
  3740. \talks{Jane}{John}
  3741. \talks{John}{me}
  3742. \talks{She}{Jane}
  3743.  
  3744. \exercise In a manner similar to the previous exercise, define a
  3745. macro {\tt \\yourgrade} so that {\tt \\yourgrade\lb89\rb\lb85\rb}
  3746. causes the following sentence to be typeset: You received a grade
  3747. of 89\% on your first exam and a grade of 85\% on your second
  3748. exam.
  3749.  
  3750. \exercise Write a macro {\tt \\frac} so that {\tt \\frac\lb
  3751. a\rb\lb b\rb} will typeset the fraction ${a\over b}$.
  3752.  
  3753. \bigskip
  3754. It's important not to put any spaces before the first brace in
  3755. the definition. If you do, \TeX{} will interpret the definition
  3756. differently from the way described here. For more than two
  3757. parameters, the method of definition is similar. To define a
  3758. control word with three parameters, start with
  3759. {\tt \\def\\newword\#1\#2\#3\lb$\ldots$\rb}. Then {\tt \#1},
  3760. {\tt \#2} and {\tt \#3} may occur between the braces. When
  3761. {\tt \\newword\lb$\ldots$\rb\lb$\ldots$\rb\lb$\ldots$\rb}
  3762. appears in the text, the material between each set of braces
  3763. replaces its corresponding symbol in the definition of the
  3764. control word. The parameters may go up to {\tt \#9}.
  3765.  
  3766. \subsection{By any other name}
  3767.  
  3768. Sometimes it's convenient to be able to give a control word an
  3769. alternative name.  For example, if you prefer a different spelling,
  3770. you might want to call the control word {\tt \\centerline} by the
  3771. name of {\tt \\centreline}.  This can be done by using the {\tt
  3772. \\let} control word.  The use of {\tt \\let \\centreline =
  3773. \\centerline} now makes a new (as well as the old) control word
  3774. available.  This can also be used with mathematical names as with
  3775. {\tt \\let \\tensor = \\otimes}.  It is then possible to use
  3776. \TeXref{206--207}
  3777.  
  3778. \toindex{let}
  3779. \toindex{centreline}
  3780. \toindex{tensor}
  3781.  
  3782. \let\tensor=\otimes
  3783. \beginuser
  3784. \$\$ (A \\tensor B) (C \\tensor D) = AC \\tensor BD. \$\$
  3785. \enduser
  3786.  
  3787. \noindent to get
  3788.  
  3789. $$ (A \tensor B) (C \tensor D) = AC \tensor BD. $$
  3790.  
  3791.  
  3792.  
  3793. \exercise Define control sequences {\tt \\ll}, {\tt \\cl}, and
  3794. {\tt \\rl} that are equivalent to {\tt \\leftline}, {\tt \\centerline},
  3795. and {\tt \\rightline}.
  3796.  
  3797. The {\tt \\let} control word allows users to name their own
  3798. control sequences.  This allows a personalized set of control
  3799. sequences that may be used in place of the ones provided by \TeX{}
  3800. when desired.
  3801.  
  3802. \section{To err is human}
  3803.  
  3804. In some ways \TeX{} is not completely divine. \TeX{} will respond
  3805. to invalid input by giving an error message to the screen if you
  3806. are using it interactively and also to the log file.  Because
  3807. \TeX{} is very complicated, the actual point where the error is
  3808. detected may be deep within the program, so a full report of the
  3809. error may be rather long and involved.    Not only that, \TeX{}
  3810. will try to recover from errors, and will report what was done in
  3811. that process.  For this reason the reading of error messages may
  3812. be a little difficult for the uninitiated.  The key is to know
  3813. what is important from your perspective and what can be safely
  3814. ignored. So let's look at some typical errors and the messages
  3815. that they generate.
  3816.  
  3817. \subsection{The forgotten bye}
  3818.  
  3819. The first mistake that we'll look at is one that everyone makes
  3820. at some time, namely, the omission of {\tt \\bye} at the end of
  3821. the file. If you're using \TeX{} interactively, an asterisk \hfil
  3822. \break
  3823. \leftline{\tt *}
  3824. will be printed on the screen and nothing will happen since,
  3825. having not been told to finish up,  \TeX{} is waiting for input
  3826. (from your keyboard).  Whatever you type in will be appended to
  3827. whatever has been input from your files.  The usual response is
  3828. to type {\tt \\bye<CR>}\fnote{{\tt <CR>} is the key
  3829. used to end a line of input.  It might be called the carriage
  3830. return, enter, or simply the return key on your terminal.
  3831. Sometimes it is indicated by a large left arrow.} since that will
  3832. finish things up.
  3833.  
  3834. \subsection{The misspelled or unknown control sequence}
  3835.  
  3836. Using a misspelled or other control sequence unknown to \TeX{} is
  3837. a common error.  If \TeX{} is being run as a batch job, an error
  3838. message is printed and the job goes on ignoring the control
  3839. sequence.  When using \TeX{} interactively, it is possible to
  3840. repair errors (of course this does not change the original input
  3841. file, so that must be done when the \TeX{} job is completed).
  3842. Suppose we have a \TeX{} input file consisting of the following
  3843. two lines:
  3844. \beginuser
  3845. \\line\lb The left side \\hfli the right side\rb
  3846. \\bye
  3847. \enduser
  3848.  
  3849. The control word should be {\tt \\hfil}, of course. Here is the
  3850. message that would be sent to your terminal:
  3851.  
  3852. \beginuser
  3853. \obeyspaces
  3854. ! Undefined  control sequence.
  3855. l.1 \\line\lb The left side \\hfli
  3856. \                               the right side\rb
  3857. ?
  3858. \enduser
  3859.  
  3860. The first line starts with {\tt !} and gives the error message.
  3861. Next comes the line number on which the error occurred and the
  3862. part of the line that was read successfully.  The next line gives
  3863. the continuation of the line after the error. At this point the
  3864. question mark means that \TeX{} is waiting for a response.  There
  3865. are several legal ones:
  3866. \nobreak
  3867. \maketable [Responses to \TeX{} error messages]
  3868. \halign{
  3869. \strut \hfil # \hfil & \quad \hfil \tt # \hfil & # \hfil\cr
  3870.    \bf Desired response & \bf Input to \TeX{} & \bf \hfil Result\cr
  3871.    \noalign{\hrule} \noalign{\smallskip}
  3872.    Help   & h<CR>& Reason for stopping listed on terminal.\cr
  3873.    Insert & i<CR>& Next line inserted into \TeX{} input file.\cr
  3874.    Exit   & x<CR>& Exit from \TeX\null. Completed pages to DVI file.\cr
  3875.    Scroll & s<CR>& List message and continue after minor errors.\cr
  3876.    Run    & r<CR>& List message and continue after any errors.\cr
  3877.    Quiet  & q<CR>& All terminal listings suppressed.\cr
  3878.    Carry on &<CR> & \TeX{} continues as best it can.\cr
  3879.       }
  3880.  
  3881. In our last example a reasonable response might be to enter {\tt
  3882. h<CR>} to get a help message, then {\tt i<CR>} to insert more
  3883. text, (at which point \TeX{} responds with {\tt insert> } and
  3884. finally {\tt \\hfil} as the correct control word.  Here is the
  3885. result:
  3886.  
  3887.  
  3888. \beginuser
  3889. ? h <CR>
  3890. The control sequence at the end of the top line
  3891. of your error message was never \\def'ed. If you have
  3892. misspelled it (e.g., `\\hobx'), type `I' and the correct
  3893. spelling (e.g., `I\\hbox'). Otherwise just continue,
  3894. and I'll forget about whatever was undefined.
  3895.  
  3896. ? i <CR>
  3897. insert>\\hfil
  3898. [1]
  3899. \enduser
  3900.  
  3901. The final {\tt [1]} means that the first (and only) page has
  3902. been completed and sent to the DVI file.  The original input file
  3903. still needs to be fixed, of course.
  3904.  
  3905. \subsection{The misnamed font}
  3906.  
  3907. A misspelled font name is an error similar to the misspelled
  3908. control sequence.  The error message is different and a little
  3909. confusing at first. Suppose for example the following appears in
  3910. your input file:
  3911.  
  3912. \leftline{\tt \\font\\sf = cmss01}
  3913.  
  3914. It should be {\tt cmss10}, that is, the numbers have been
  3915. transposed.  Here are the error and help messages:
  3916.  
  3917. \beginuser \obeyspaces
  3918. ! Font \\sf=cmss01 not loadable: Metric (TFM) file not found.
  3919. <to be read again>
  3920. \                   \\par
  3921. \\bye ->\\par
  3922. \            \\vfill \\supereject \\end
  3923. l.2 \\bye
  3924.  
  3925. ? h <CR>
  3926. I wasn't able to read the size data for this font,
  3927. so I will ignore the font specification.
  3928. [Wizards can fix TFM files using TFtoPL/PLtoTF.]
  3929. You might try inserting a different font spec;
  3930. e.g., type `I\\font<same font id>=<substitute font name>'.
  3931. \enduser
  3932.  
  3933. The TFM (\TeX{} font metric) file is an auxiliary file that is
  3934. used by \TeX\null. So this strange message is just telling you
  3935. that the font you defined doesn't exist on your computer system.
  3936.  
  3937. \subsection{Mismatched mathematics}
  3938.  
  3939. Another common error is to use {\tt \$} or {\tt \$\$} to start a
  3940. mathematical expression and then to forget the second {\tt \$}
  3941. or {\tt \$\$} when finished.  The text that follows is then
  3942. treated as mathematics, and to make matters worse, if more
  3943. mathematics is started by a new {\tt \$} or {\tt \$\$}, it will
  3944. then be treated as ordinary text.  Needless to say, error
  3945. messages galore may be generated. \TeX{} will attempt to correct
  3946. the problem by inserting a new {\tt \$} or {\tt \$\$}; in any
  3947. case, the problem is corrected by the end of the paragraph since
  3948. a new paragraph will automatically start as ordinary text.
  3949.  
  3950. Consider the following correct input and its output:
  3951. \beginuser
  3952. Since \$f(x) > 0\$, \$a<b\$,  and \$f(x)\$ is continuous, we know that
  3953. \$\\int\_{}a\^{}b f(x)\\,dx >0\$.
  3954. \enduser
  3955.  
  3956. Since $f(x) > 0$, $a<b$,  and $f(x)$ is continuous, we know that
  3957. $\int_a^b f(x)\,dx >0$.
  3958.  
  3959. If we now leave out the second dollar sign in {\tt \$f(x)\$} we
  3960. then get the following error and help messages:
  3961.  
  3962. \beginuser \obeyspaces
  3963. ! Missing \$ inserted.
  3964. <inserted text>
  3965. \               \$
  3966. <to be read again>
  3967. \                  \\intop
  3968. \\int ->\\intop
  3969. \             \\nolimits
  3970. l.2 \$\\int
  3971. \          \_{}a\^{}b f(x)\\,dx >0\$.
  3972. ? h <CR>
  3973. I've inserted a begin-math/end-math symbol since I think
  3974. you left one out. Proceed, with fingers crossed.
  3975.  
  3976. ?
  3977. \enduser
  3978.  
  3979. The line starting with {\tt !} tells us what has been done. The
  3980. line starting with {\tt l.2} shows us where we were in the input
  3981. file when the error occurred.  As in our other examples, the part
  3982. of the line successfully read, that is, through {\tt \\int},
  3983. appears on one line, and the continuation appears on the next
  3984. line. The remaining material may seem somewhat obscure.  These
  3985. intermediate messages show what was happening further in the guts
  3986. of the \TeX{} program when the error occurred.  The newer user
  3987. may ignore them.
  3988.  
  3989. Here is what you get as output after \TeX{} tries to recover from
  3990. the error.
  3991.  
  3992. Since $f(x) > 0$, $a<b$,  and $f(x) is continuous, we know that
  3993. \int_a^b f(x)\,dx >0$.
  3994.  
  3995. There is a stretch of text that is italic with no spacing.  This
  3996. is typical for normal text being processed as mathematics; if you
  3997. see this in your output, you have almost certainly left out a
  3998. {\tt \$} or {\tt \$\$}.
  3999.  
  4000. \subsection{Mismatched braces}
  4001.  
  4002. It's easy to forget or mismatch the closing braces when making
  4003. groups.  The result may be a relatively benign error, or it may
  4004. be catastrophic. Suppose, for example, you have {\tt \lb\\bf A
  4005. bold title } in your text with the closing right brace omitted.
  4006. The result will be the same as if no opening brace were there;
  4007. that is, the rest of the paper will be boldface if no other font
  4008. changes are made.  You will get the following message at the end
  4009. of the file:
  4010.  
  4011. {\tt (\\end occurred inside a group at level 1)}
  4012.  
  4013. If you had made the same mistake twice, then there would be two
  4014. more opening braces than closing braces, and you would get the
  4015. message:
  4016.  
  4017. {\tt (\\end occurred inside a group at level 2)}
  4018.  
  4019. \TeX{} doesn't know that the closing brace is missing until it
  4020. reaches the end of the input file.  Hence the message doesn't
  4021. tell you where you went wrong.  If the location of the missing
  4022. brace isn't obvious, it's always possible to insert {\tt \\bye}
  4023. halfway through your document.  Running \TeX{} again will cause
  4024. only the first half to be processed, and if the error message
  4025. persists, you will know that the error is in the first half of
  4026. the document.  By moving the {\tt \\bye} to different places, the
  4027. error can be localized.  Also, looking at the output often
  4028. reveals what has gone wrong.
  4029.  
  4030. Missing opening braces are much easier to spot.  Here is a two
  4031. line input file and the resulting error and help messages:
  4032.  
  4033. \beginuser
  4034. \\bf Here is the start\rb, but there is the finish.
  4035. \\bye
  4036. \enduser
  4037.  
  4038. \beginuser \obeyspaces
  4039. ! Too many \rb's.
  4040. l.1 \\bf Here is the start\rb
  4041. \                          , but there is the finish.
  4042.  
  4043. ? h <CR>
  4044. You've closed more groups than you opened.
  4045. Such booboos are generally harmless, so keep going.
  4046. \enduser
  4047.  
  4048. It's quite possible, of course, that the line that is supposed to
  4049. have the missing left brace will not be on the line where \TeX{}
  4050. catches the error.
  4051.  
  4052. A mismatched brace in the definition of a new control sequence
  4053. can cause a major error.  Since such a definition may include
  4054. several paragraphs, it may not be caught by the end of a
  4055. paragraph, but, rather will just keep piling more and more text
  4056. into the unfinished definition.  It's even possible for \TeX{} to
  4057. run out of memory as it keeps eating up more text! This is called
  4058. a ``runaway definition''.
  4059. \TeXref{206}
  4060. Here is a two line input file with a runaway definition:
  4061.  
  4062. \vbox{
  4063. \beginuser
  4064. \\def\\newword\lb the def
  4065. \\newword
  4066. \\bye
  4067. \enduser
  4068. }
  4069.  
  4070. Here are the resulting error and help messages:
  4071.  
  4072. \beginuser \obeyspaces
  4073. Runaway definition?
  4074. ->the def
  4075. ! Forbidden control sequence found while scanning definition of \\newword.
  4076. <inserted text>
  4077. \                \rb
  4078. <to be read again>
  4079. \                   \\bye
  4080. l.3 \\bye
  4081.  
  4082. ? h <CR>
  4083. I suspect you have forgotten a `\rb', causing me
  4084. to read past where you wanted me to stop.
  4085. I'll try to recover; but if the error is serious,
  4086. you'd better type `E' or `X' now and fix your file.
  4087.  
  4088. ? <CR>
  4089. No pages of output.
  4090. \enduser
  4091.  
  4092. This is obviously a serious error.  If it occurs at the beginning
  4093. of a file (as in the previous example), there will be no output
  4094. at all!
  4095.  
  4096. If a closing brace is left out while using a macro with
  4097. parameters, the runaway definition will be terminated at the end
  4098. of the paragraph. So if {\tt \\def\\newword\#1\lb$\ldots$\rb} has
  4099. been defined and you use {\tt \\newword\lb$\dots$ } without the
  4100. closing brace, then at most one paragraph will be ruined.
  4101. \TeXref{205}
  4102.  
  4103. In short, when an error occurs, make a note of the line number to
  4104. see how much of the input file has been read, and also the line
  4105. starting with an exclamation point to get a short description of
  4106. the error. If the error is still not clear, ask \TeX{} for more
  4107. information by typing {\tt h<CR>}. For small errors, \TeX{} can
  4108. carry on quite a way if you just keep hitting the {\tt <CR>}.
  4109.  
  4110.  
  4111.  
  4112.  
  4113. \section{Digging a little deeper}
  4114.  
  4115. In this section we look at a few topics that allow \TeX{} to be
  4116. used with greater flexibility or efficiency.  As the documents
  4117. being produced get longer, different techniques can help make
  4118. their creation easier.
  4119.  
  4120. \subsection{Big files, little files}
  4121.  
  4122. \TeX{} can read and write files as it runs.  This makes it
  4123. possible to use files that are smaller and more convenient to
  4124. handle by creating a master file that reads the smaller files in
  4125. the proper order. This document, for example, consists of ten
  4126. sections plus an introduction.  In addition, there are macros
  4127. that are used for all sections. The macros can be put in a file
  4128. called, say, {\tt macros.tex}, the introduction can be put in {\tt
  4129. intro.tex}, and each section put in its own file.  The control
  4130. word {\tt \\input} is then used to read in a file.  In general,
  4131. {\tt \\input filename} will cause the file called {\tt
  4132. filename.tex} to be read in and processed immediately, just as if
  4133. the text of {\tt filename.tex} had been part of the file that
  4134. read it in.  This file may input other files. In fact it's often
  4135. convenient to make a single file that reads in smaller pieces,
  4136. perhaps as follows:
  4137. \toindex{input}
  4138.  
  4139. \beginuser
  4140. \\input macros
  4141. \\input intro
  4142. \\input sec1
  4143. \\input sec2
  4144. \\input sec3
  4145. \\input sec4
  4146. \\input sec5
  4147. \\input sec6
  4148. \\input sec7
  4149. \\input sec8
  4150. \\input sec9
  4151. \\input sec10
  4152. \enduser
  4153.  
  4154. While the text is still being heavily edited, it's possible to
  4155. process only some of the files by putting a {\tt \%} at the
  4156. beginning of each line that contains a file to be skipped (this
  4157. is sometimes called ``commenting out'' the unwanted files).
  4158.  
  4159. The {\tt \\input} control word also allows the use of
  4160. predesigned macros.  The macros for a memorandum, for example,
  4161. might be put in a file called {\tt memo.tex}.  These macros might
  4162. set up the right {\tt \\hsize}, {\tt \\vsize} and other
  4163. parameters, and might stamp the time and date.  Once this has
  4164. been set up, all memoranda may be started with {\tt \\input memo}
  4165. to make them come out with a common format.
  4166.  
  4167. Be sure that you don't have the control word {\tt \\bye} in your
  4168. input file or the \TeX{} program will stop at that point.
  4169.  
  4170. \exercise Make a \TeX{} input file that reads in a second file.
  4171. Try reading in the second file twice using the {\tt \\input}
  4172. control word twice.
  4173.  
  4174. \subsection{Larger macro packages}
  4175.  
  4176. Designing macros that can be used with many types of documents
  4177. is obviously useful.  Most universities, for example, have
  4178. specific and often complicated format requirements for theses.  A
  4179. collection of macros, that is, a macro package that meets all
  4180. these specifications could be somewhat time consuming to design
  4181. and could be quite long.  It is possible to use the {\tt \\input}
  4182. command to use such a macro package, just as it is possible to
  4183. use it with your own macros.  But \TeX{} has a better facility
  4184. for larger packages.
  4185.  
  4186. A macro package can be put in a special form that can be quickly
  4187. read by \TeX\null.  This is called a {\sl format file}, and
  4188. the exact form is of technical interest only.  The important
  4189. thing is it allows \TeX{} to be run with many new control
  4190. sequences predefined. Certain commands called {\sl primitives\/}
  4191. are part of the definition of \TeX\null.
  4192.  
  4193. What we have described in this manual is sometimes called {\sl
  4194. plain \TeX\/}, and consists of the \TeX{} primitives plus a set
  4195. of macros in a format file (that is usually included in \TeX{}
  4196. automatically) called {\tt plain.fmt}. For the curious, any
  4197. control word can be viewed using {\tt \\show}.  The command {\tt
  4198. \\show\\centerline} will display
  4199. \beginliteral
  4200. > \centerline=macro:
  4201. #1->\line {\hss #1\hss }.
  4202. @endliteral
  4203. \noindent
  4204. on the screen and in the log file. You can use {\tt \\show} with
  4205. your own macros, too.  If you end up using several macro
  4206. packages, you can use the {\tt \\show} command to see if a
  4207. particular macro is defined.
  4208.  
  4209. Many computer \centre{}s have the \LaTeX{} macro package.  This
  4210. package allows the user to create an index, a table of contents,
  4211. and a bibliography automatically.  It also has the ability to
  4212. insert some elementary graphic figures such as circles, ovals,
  4213. lines, and arrows. \LaTeX{} also uses special predifined files
  4214. called {\sl style files\/} to set up
  4215. specific page parameters. Many different style files are
  4216. available; some journals will accept papers on a magnetic medium
  4217. for direct processing if they are prepared using \LaTeX{} and a
  4218. designated style file. It is not difficult to shift from \TeX{}
  4219. to \LaTeX\null. A user's guide by the author of the macro
  4220. package, Leslie Lamport, is available:
  4221. {\bf \LaTeX{}: A document preparation system}%
  4222. \fnote{Addison-Wesley, Reading, Massachusetts, 1986,
  4223. ISBN 0-201-15790-X.}.
  4224.  
  4225. The American Mathematical Society uses the \AMSTeX{} macro
  4226. package for its journals.  It is readily available from that
  4227. Society, and papers may be submitted to their journals on a
  4228. magnetic medium using \AMSTeX\null.  A manual by Michael Spivak,
  4229. {\bf The Joy of \TeX{}}\fnote{American Mathematical
  4230. Society, 1986, ISBN 0-8218-2999-8}, is available from the
  4231. American Mathematical Society.
  4232.  
  4233. Other macro packages exist, and undoubtedly more will be
  4234. developed. They are usually of modest cost and can be very
  4235. effective in some circumstances.  The \TeX{} Users Group
  4236. announces the existence of new macro packages in its
  4237. publications.
  4238.  
  4239. \subsection{Horizontal and vertical lines}
  4240.  
  4241. Making horizontal and vertical lines is easy using \TeX\null.
  4242. When typing in text, {\tt \\hrule } will cause the current
  4243. paragraph to end, will draw a horizontal line whose width is the
  4244. current value of {\tt \\hsize}, and then will continue on with a
  4245. new paragraph.  It's possible to specify the width of the hrule
  4246. as, for example, with {\tt \\hrule width 5 cm}; also you can use
  4247. {\tt \\vskip} or {\tt \\bigskip} to put some space above or below
  4248. the hrule.  Here is an example:
  4249.  
  4250. \beginuser
  4251. \\parindent = 0 pt \\parskip = 12 pt
  4252. Here is the text before the hrule.
  4253. \\bigskip
  4254. \\hrule width 3 in
  4255. And here is some text after the hrule.
  4256. \enduser
  4257.  
  4258. \noindent that produces
  4259. \vfill\eject
  4260.  
  4261. {
  4262. \parindent = 0 pt
  4263. Here is the text before the hrule.
  4264. \bigskip
  4265. \hrule width 3 in
  4266. And here is some text after the hrule.
  4267. }
  4268.  
  4269. In fact this hrule not only has width of three inches, but also
  4270. by default has a height (the amount by which the hrule extends
  4271. above the baseline on which the type is being set) of 0.4 points
  4272. and a depth (the amount by which the hrule extends below the
  4273. baseline on which the type is being set) of 0 points.  Each of
  4274. these parameters can be individually set.  Thus if we change the
  4275. last example to say
  4276.  
  4277. {\tt \\hrule width 3 in height 2 pt depth 3 pt } we get
  4278.  
  4279. {
  4280. \parindent = 0 pt
  4281. Here is the text before the hrule.
  4282. \bigskip
  4283. \hrule width 3 in height 2 pt depth 3 pt
  4284. And here is some text after the hrule.
  4285. }
  4286.  
  4287. The three parameters {\tt width}, {\tt height}, and {\tt depth} may
  4288. be given in any order.
  4289. \toindex{hrule}
  4290. \TeXref{221--222}
  4291.  
  4292. A vrule may be defined analogously to an hrule by specifying the
  4293. {\tt width}, {\tt height}, and {\tt depth} if desired.
  4294. \TeXref{221--222}
  4295. But, unlike the hrule, the vrule will not automatically start a
  4296. new paragraph when it appears.  By default the vrule will be 0.4
  4297. points wide, and will be as high as the line on which it is being
  4298. set. Hence
  4299.  
  4300. \toindex{vrule}
  4301.  
  4302. \beginuser
  4303. Here is some text before the vrule
  4304. \\vrule\\
  4305. and this follows the vrule.
  4306. \enduser
  4307.  
  4308. \noindent will give
  4309.  
  4310. Here is some text before the vrule
  4311. \vrule\
  4312. and this follows the vrule.
  4313.  
  4314. \exercise Make three horizontal lines that are 15 points apart,
  4315. 3 inches in length, and one inch in from the left margin.
  4316.  
  4317. Although we usually think of hrules and vrules as horizontal and
  4318. vertical lines, they need not necessarily be used that way.  For
  4319. example:
  4320.  
  4321. \beginuser
  4322. \\noindent
  4323. Name: \\vrule height 0 pt depth 0.4 pt width 3 in
  4324. \enduser
  4325.  
  4326. \noindent will give
  4327.  
  4328. \noindent
  4329. Name: \vrule height 0 pt depth 0.4 pt width 3 in
  4330.  
  4331. \exercise Make the following grid (each box is 1 \centimetre{} square):
  4332. \medskip
  4333. \settabs \+ \hskip 1cm&\hskip 1 cm&\hskip 1 cm& \cr
  4334. \moveright 2 in
  4335. \vbox{
  4336. \hrule width 3 cm
  4337. \+  \vrule height 1 cm & \vrule height 1 cm & \vrule height 1 cm
  4338.   & \vrule height 1 cm \cr
  4339. \hrule width 3 cm
  4340. \+  \vrule height 1 cm & \vrule height 1 cm & \vrule height 1 cm
  4341.   & \vrule height 1 cm \cr
  4342. \hrule width 3 cm
  4343. \+  \vrule height 1 cm & \vrule height 1 cm & \vrule height 1 cm
  4344.   & \vrule height 1 cm \cr
  4345. \hrule width 3 cm
  4346. }
  4347.  
  4348.  
  4349. \subsection{Boxes within boxes}
  4350.  
  4351. We have already seen (in our discussion of line shapes) that
  4352. vboxes and hboxes are objects that may be overfull or underfull.
  4353. In this section we will look at these boxes in a bit more detail.
  4354. They may be stacked or lined up to allow a variety of positions
  4355. for text on the page.
  4356.  
  4357. An hbox is formed by using {\tt \\hbox\lb $\ldots$\rb}\null.
  4358. Once the material between the braces has been put into an hbox,
  4359. it is set and can not be further split (this means that material
  4360. that must go on one line can be put into an hbox, and it will
  4361. then remain as one unit).  It's possible to specify the size of
  4362. an hbox.\TeXref{64--66} Thus {\tt \\hbox to 5 cm\lb contents of
  4363. the box\rb } will produce an hbox exactly five \centimetre{}s
  4364. wide containing the typeset text ``contents of the box''.
  4365. It's easy to get an underfull or overfull box in this way. An
  4366. underfull box can be avoided by using {\tt \\hfil} to absorb the
  4367. extra space. When no dimension is given, an hbox is formed that
  4368. is just wide enough to hold the enclosed text.
  4369. \toindex{hbox}
  4370.  
  4371. Similarly, vboxes are formed using {\tt \\vbox\lb $\ldots$\rb}.
  4372. What makes these boxes interesting is that when a vbox contains
  4373. hboxes, these hboxes are stacked one above the other and set as a
  4374. unit. Similarly, an hbox can contain vboxes, which will be set in
  4375. a row. Suppose we take three hboxes and put them in a vbox:
  4376. \toindex{vbox}
  4377.  
  4378. \beginuser \obeyspaces
  4379. \\vbox\lb
  4380. \      \\hbox\lb{}Contents of box 1\rb
  4381. \      \\hbox\lb{}Contents of box 2\rb
  4382. \      \\hbox\lb{}Contents of box 3\rb
  4383. \      \rb
  4384. \enduser
  4385.  
  4386. \noindent gives
  4387. \vskip \baselineskip
  4388. \vbox{
  4389.       \hbox{Contents of box 1}
  4390.       \hbox{Contents of box 2}
  4391.       \hbox{Contents of box 3}
  4392.       }
  4393.  
  4394. Now suppose we take another vbox:
  4395.  
  4396. \beginuser \obeyspaces
  4397. \\vbox\lb
  4398. \      \\hbox\lb{}Contents of box 4\rb
  4399. \      \\hbox\lb{}Contents of box 5\rb
  4400. \      \rb
  4401. \enduser
  4402.  
  4403. These two vboxes can be put into an hbox; this will cause them to
  4404. be placed side by side. In other words
  4405.  
  4406. \beginuser \obeyspaces
  4407. \\hbox\lb
  4408. \     \\vbox\lb
  4409. \           \\hbox\lb{}Contents of box 1\rb
  4410. \           \\hbox\lb{}Contents of box 2\rb
  4411. \           \\hbox\lb{}Contents of box 3\rb
  4412. \           \rb
  4413. \     \\vbox\lb
  4414. \           \\hbox\lb{}Contents of box 4\rb
  4415. \           \\hbox\lb{}Contents of box 5\rb
  4416. \           \rb
  4417. \     \rb
  4418. \enduser
  4419.  
  4420. \noindent gives
  4421. \vskip \baselineskip
  4422. \hbox{
  4423.      \vbox{
  4424.            \hbox{Contents of box 1}
  4425.            \hbox{Contents of box 2}
  4426.            \hbox{Contents of box 3}
  4427.            }
  4428.      \vbox{
  4429.            \hbox{Contents of box 4}
  4430.            \hbox{Contents of box 5}
  4431.           }
  4432.      }
  4433.  
  4434.  
  4435. Notice that the two vboxes are aligned so that the bottoms are
  4436. level; also there is a little space at the beginning of each line
  4437. and also between the vboxes.  Actually, the reason these spaces
  4438. appear is rather subtle. Unless a line ends in a control word,
  4439. there is always a space between the last entry in one line and
  4440. the first one in the next line. For this reason the space between
  4441. the vboxes comes from the end of the line containing the closing
  4442. brace of the first vbox.  Similarly, the spaces at the beginning
  4443. of the line is caused by the space after the opening brace of the
  4444. hbox. These spaces can be avoided by ``commenting out'' the end of
  4445. the line, that is, by putting a {\tt \%} immediately after the
  4446. closing brace of the first vbox or the opening brace of the hbox.
  4447. If you try to put some vboxes together and accidentally get extra
  4448. space by forgetting to comment out the end of the line, you're in
  4449. good company.  Some very able and experienced \TeX{} users have
  4450. done the same thing!
  4451.  
  4452. Extra space, say one \centimetre,  can be added by putting an
  4453. {\tt \\hskip 1 cm } between the vboxes.  They can be aligned so
  4454. that the tops are level by using {\tt \\vtop } instead of
  4455. {\tt \\vbox}.  Making these two changes results in:
  4456.  
  4457. \toindex{vtop}
  4458. \vskip \baselineskip
  4459. \hbox{
  4460.      \vtop{
  4461.            \hbox{Contents of box 1}
  4462.            \hbox{Contents of box 2}
  4463.            \hbox{Contents of box 3}
  4464.            }
  4465.      \hskip 1 cm
  4466.      \vtop{
  4467.            \hbox{Contents of box 4}
  4468.            \hbox{Contents of box 5}
  4469.           }
  4470.      }
  4471.  
  4472.  
  4473. We can combine vboxes, hboxes, vrules, and hrules to get boxed
  4474. text.  How might we construct such a box? One way is to take the
  4475. material to be boxed and put it in an hbox preceded and followed
  4476. by a vrule.  Then put this in a vbox with hrules above and below
  4477. it. This gives us:
  4478.  
  4479. \beginuser \obeyspaces
  4480. \\vbox\lb
  4481. \      \\hrule
  4482. \      \\hbox\lb\\vrule{} The text to be boxed \\vrule\rb
  4483. \      \\hrule
  4484. \     \rb
  4485. \enduser
  4486.  
  4487. \noindent which results in
  4488. \vskip \baselineskip
  4489. \vbox{
  4490.       \hrule
  4491.       \hbox{\vrule{} The text to be boxed \vrule}
  4492.       \hrule
  4493.      }
  4494.  
  4495. This produces boxed material, but there is no margin around it
  4496. and so it looks very cramped (of course \TeX{} is just giving us
  4497. what we asked for).  We can improve the spacing by putting a {\tt
  4498. \\strut} at the beginning of the hbox to make it a little taller
  4499. and deeper.  This gives us:
  4500. \vskip \baselineskip
  4501. \vbox{
  4502.       \hrule
  4503.       \hbox{\strut \vrule{} The text to be boxed \vrule}
  4504.       \hrule
  4505.      }
  4506.  
  4507. \def\boxtext#1{%
  4508. \vbox{%
  4509.       \hrule
  4510.       \hbox{\strut \vrule{} #1 \vrule}%
  4511.       \hrule
  4512.      }%
  4513. }
  4514.  
  4515. \exercise Why is it that we were forced to add extra space above
  4516. and below the text but not before and after it?
  4517.  
  4518.  
  4519. \exercise Use the method of boxing material to put text \centred{}
  4520. in a box which extends from the left to the right margin.
  4521.  
  4522. \exercise By stacking nine little boxes, make the following magic square:
  4523. \vskip\baselineskip
  4524.  
  4525. \moveright 2 in \vbox{\offinterlineskip
  4526. \hbox{\boxtext 6\boxtext 1\boxtext 8}
  4527. \hbox{\boxtext 7\boxtext 5\boxtext 3}
  4528. \hbox{\boxtext 2\boxtext 9\boxtext 4}
  4529. }
  4530.  
  4531. \exercise Notice that the magic square in the previous exercise
  4532. has internal lines that are twice as thick as the outside ones.
  4533. Also, there is a tiny space at the intersection of the internal
  4534. lines. Fix up the magic square so this doesn't happen.
  4535.  
  4536. \def\boxtext#1 {%
  4537. \vbox{%
  4538.       \hrule
  4539.       \hbox{\strut \vrule #1\vrule}%
  4540.       \hrule
  4541.      }
  4542. }
  4543.  
  4544. \exercise Write a macro { \tt \\boxtext\#1\lb$\ldots$\rb } which
  4545. will take the text between the braces and put a box around it.  Test
  4546. your macro by making up a sentence with every other word boxed.
  4547. I'm \boxtext not quite \boxtext sure why \boxtext someone
  4548. would \boxtext do this \boxtext since the \boxtext result is \boxtext
  4549. pretty strange. Note how the baseline and the bottom of
  4550. the surrounding boxes align.
  4551.  
  4552. \def\boxtext#1 {%
  4553. \lower 3.5pt \hbox{%
  4554.     \vbox{%
  4555.          \hrule
  4556.          \hbox{\strut \vrule #1\vrule}%
  4557.          \hrule
  4558.         }
  4559.     }
  4560. }
  4561.  
  4562. It's easy to move boxes up, down, left, or right on the page. A
  4563. {\tt \\vbox} can be moved to the right one inch by using {\tt
  4564. \\moveright 1 in \\vbox\lb\dots\rb}.  To move it to the left,
  4565. use {\tt \\moveleft}.  Similarly, an {\tt \\hbox} can be moved up
  4566. or down using {\tt \\raise} or {\tt \\lower}.
  4567. \toindex{moveright}
  4568. \toindex{moveleft}
  4569. \toindex{raise}
  4570. \toindex{lower}
  4571.  
  4572. \exercise Rewrite the {\tt \\boxtext} macro from the previous
  4573. exercise so that all of the text is aligned (hint: by default the
  4574. depth of a strut is 3.5 points).  This would give a sentence like
  4575. the following: I'm \boxtext not quite \boxtext sure why \boxtext
  4576. someone would \boxtext do this \boxtext since the \boxtext result
  4577. is \boxtext pretty strange.
  4578.  
  4579. It's possible to fill a box with either an hrule or with dots.
  4580. The idea is to use {\tt \\hrulefill } or {\tt \\dotfill } in the
  4581. hbox.
  4582.  
  4583. \beginuser
  4584. \\hbox to 5 in\lb Getting Started\\hrulefill 1\rb
  4585. \\hbox to 5 in\lb All Characters Great and Small\\hrulefill 9\rb
  4586. \\hbox to 5 in\lb The Shape of Things to come\\hrulefill 17\rb
  4587. \\hbox to 5 in\lb No Math Anxiety Here!\\hrulefill 30\rb
  4588. \enduser
  4589.  
  4590. \noindent gives
  4591. \vskip \baselineskip
  4592.  
  4593. \hbox to 5 in{Getting Started\hrulefill 1}
  4594. \hbox to 5 in{All Characters Great and Small\hrulefill 9}
  4595. \hbox to 5 in{The Shape of Things to come\hrulefill 17}
  4596. \hbox to 5 in{No Math Anxiety Here!\hrulefill 30}
  4597.  
  4598. If {\tt \\hrulefill} is replaced by {\tt \\dotfill} we get
  4599. \vskip \baselineskip
  4600.  
  4601. \hbox to 5 in{Getting Started\dotfill 1}
  4602. \hbox to 5 in{All Characters Great and Small\dotfill 9}
  4603. \hbox to 5 in{The Shape of Things to come\dotfill 17}
  4604. \hbox to 5 in{No Math Anxiety Here!\dotfill 30}
  4605.  
  4606. \exercise Make a boxed headline appear at the top of the page
  4607. that is like the one used in this manual.
  4608.  
  4609.  
  4610.  
  4611. \section{Control word list}
  4612.  
  4613. Here is a list of the control words given in this manual.
  4614. If you want more detail about these words than is given here,
  4615. check the index of {\bf The \TeX book}.
  4616.  
  4617. \vskip 2\baselineskip
  4618. \centerline{Control symbols}
  4619. \vskip\baselineskip
  4620.  
  4621. \settabs \+ \hskip 1.5 in & \hskip 1.65in & \hskip 1.3in & \cr
  4622. {\tt
  4623. \+  \\\sp{} 4 & \\!\ 34  & \\" 11 & \\' 11    \cr
  4624. \+  \\, 34    & \\.\ 11  & \\/ 16 & \\; 34    \cr
  4625. \+  \\= 11    & \\> 34   & \\\# 10&  \\\$ 6  \cr
  4626. \+  \\\% 6    & \\\& 10   & \\\char '173{} 10  & \\\char '175{} 10 \cr
  4627. \+  \\\underbar{ } 10 & \\` 11 & \\{\accent "7E } 10 & \\{\accent 94 } 10 \cr
  4628. \+  \\| 40 \cr
  4629. }
  4630.  
  4631. \vskip 2\baselineskip
  4632. \centerline{Control words}
  4633. \vskip\baselineskip
  4634.  
  4635. {\tt
  4636. \+ \\AA 12 & \\aa 12 & \\acute 36 & \\AE 12 \cr
  4637. \+ \\ae 12 & \\aleph 37 & \\alpha 35 & \\angle 37 \cr
  4638. \+ \\approx 37 & \\arccos 41 & \\arcsin 41 & \\arctan 41 \cr
  4639. \+ \\arg 41 & \\ast 36 & \\b 12 & \\backslash 37 \cr
  4640. \+ \\bar 36 & \\baselineskip 22 & \\beta 35 & \\bf 16 \cr
  4641. \+ \\biggl 40 & \\Biggl 40 & \\biggr 40 & \\Biggr 40 \cr
  4642. \+ \\bigl 40 & \\Bigl 40 & \\bigr 40 & \\Bigr 40 \cr
  4643. \+ \\bigskip 26 & \\break 26 & \\breve 36 & \\bullet 36 \cr
  4644. \+ \\bye 4 & \\c 12 & \\cap 36 & \\cdot 36 \cr
  4645. \+ \\centerline 26 & \\centreline 60 & \\check 36 & \\chi 35 \cr
  4646. \+ \\circ 35 & \\columns 48 & \\cos 41 & \\cosh 41 \cr
  4647. \+ \\cot 41 & \\coth 41 & \\csc 41& \\cup 36 \cr
  4648. \+ \\d 12 & \\ddag 27 & \\ddot 36 & \\def 55 \cr
  4649. \+ \\deg 41 & \\delta 35 & \\Delta 35 & \\det 41 \cr
  4650. \+ \\diamond 36 & \\dim 41 & \\div 36 & \\dot 36 \cr
  4651. \+ \\dotfill 49 & \\dots 14 & \\downarrow 41 & \\Downarrow 41 \cr
  4652. \+ \\eject 20 & \\ell 37 & \\endinsert 26 & \\epsilon 35 \cr
  4653. \+ \\eqalign 45 & \\eqalignno 46 & \\eqno 46 & \\equiv 37 \cr
  4654. \+ \\eta 35 & \\exists 37 & \\exp 41 & \\flat 37 \cr
  4655. \+ \\folio 28 & \\font 16 & \\footline 28 & \\footnote 27 \cr
  4656. \+ \\forall 37 & \\gamma 35 & \\Gamma 35 & \\gcd 41 \cr
  4657. \+ \\geq 37 & \\grave 36 & \\H 12 & \\halign 51 \cr
  4658. \+ \\hang 23 & \\hangafter 23 & \\hangindent 23 & \\hat 36 \cr
  4659. \+ \\hbadness 29 & \\hbox 72 & \\headline 28 & \\hfil 27 \cr
  4660. \+ \\hfill 26 & \\hfuzz 29 & \\hoffset 20 & \\hom 41 \cr
  4661. \+ \\hrule 71 & \\hrulefill 49 & \\hsize 20 & \\hskip 27 \cr
  4662. \+ \\hyphenation 30 & \\i 11 & \\Im 37 & \\in 37 \cr
  4663. \+ \\inf 41 & \\infty 37 & \\input 68 & \\int 38 \cr
  4664. \+ \\iota 35 & \\it 16 & \\item 24 & \\itemitem 24 \cr
  4665. \+ \\j 11 & \\kappa 35 & \\ker 41 & \\L 12 \cr
  4666. \+ \\l 12 &  \\lambda 35 & \\Lambda 35 & \\langle 41 \cr
  4667. \+ \\lceil 41 &  \\left 44 & \\leftline 26 & \\leftskip 23 \cr
  4668. \+ \\leq 37 &  \\leqalignno 46 & \\leqno 46 & \\let 61 \cr
  4669. \+ \\lfloor 41 &  \\lg 41 & \\lim 38 & \\liminf 41 \cr
  4670. \+ \\limsup 41 &  \\line 26 & \\ln 41 & \\log 41 \cr
  4671. \+ \\lower 75 &  \\magnification 21 & \\magstep 16 & \\matrix 44 \cr
  4672. \+ \\max 41 &  \\medskip 26 & \\min 41 & \\moveleft 75 \cr
  4673. \+ \\moveright 75 &  \\mu 35 & \\nabla 37 & \\narrower 23 \cr
  4674. \+ \\natural 37 &  \\neg 37 & \\ni 37 & \\noalign 52 \cr
  4675. \+ \\noindent 22 &  \\nopagenumbers 5 & \\not 36 & \\nu 35 \cr
  4676. \+ \\O 12 &  \\o 12 & \\odot 36 & \\OE 12 \cr
  4677. \+ \\oe 12 &  \\offinterlineskip 53 & \\omega 35 & \\Omega 35 \cr
  4678. \+ \\ominus 36 &  \\oplus 36 & \\otimes 36 & \\over 37 \cr
  4679. \+ \\overfullrule 29 &  \\overline 39 & \\P 27 & \\pageno 28 \cr
  4680. \+ \\par 7 &  \\parallel 37 & \\parindent 23 & \\parshape 24 \cr
  4681. \+ \\parskip 22 &  \\partial 37 & \\perp 37 & \\phi 35 \cr
  4682. \+ \\Phi 35 &  \\pi 35 & \\Pi 35 & \\pmatrix 43 \cr
  4683. \+ \\Pr 41 &  \\proclaim 42 & \\psi 35 & \\Psi 35 \cr
  4684. \+ \\qquad 34 &  \\quad 34 & \\raggedright 27 & \\raise 75 \cr
  4685. \+ \\rangle 41 &  \\rceil 41 & \\Re 37 & \\rfloor 41 \cr
  4686. \+ \\rho 35 &  \\right 44 & \\rightline 26 & \\rightskip 23 \cr
  4687. \+ \\rm 16 &  \\root 39 & \\S 27 & scaled 16 \cr
  4688. \+ \\sec 41 &  \\settabs 48 & \\sharp 37 & \\sigma 35 \cr
  4689. \+ \\Sigma 35 &  \\sim 37 & \\simeq 37 & \\sin 41 \cr
  4690. \+ \\sinh 41 &  \\sl 16 & \\smallskip 26 & \\sqroot 39 \cr
  4691. \+ \\ss 12 &  \\star 36 & \\strut 50 & \\subset 37 \cr
  4692. \+ \\subseteq 37 &  \\sum 38 & \\sup 41 & \\supset 37 \cr
  4693. \+ \\supseteq 37 &  \\surd 39 & \\t 12 & \\tan 41 \cr
  4694. \+ \\tanh 41 &  \\tau 35 & \\tensor 60 & \\TeX{} 5 \cr
  4695. \+ \\tensor 60 &  \\the 28 & \\theta 35 & \\Theta 35 \cr
  4696. \+ \\tilde 36 &  \\times 36 & \\tolerance 29  & \\topinsert 26 \cr
  4697. \+ \\tt 16 &  \\u 12 & \\underbar 39 & \\underline 39 \cr
  4698. \+ \\uparrow 41 &  \\Uparrow 41 & \\updownarrow 41 & \\Updownarrow 41 \cr
  4699. \+ \\upsilon 35 &  \\Upsilon 35 & \\v 12 & \\varepsilon 35 \cr
  4700. \+ \\varphi 35 &  \\varrho 35 & \\varsigma 35 & \\vartheta 35 \cr
  4701. \+ \\vbadness 30 &  \\vbox 71 & \\vec 36 & \\vee 36 \cr
  4702. \+ \\vfill 20 &  \\vglue 25 & \\voffset 20 & \\vrule 71 \cr
  4703. \+ \\vsize 20 & \\vtop 74 &  \\wedge 36 & \\widehat 36 \cr
  4704. \+ \\widetilde 36 & \\xi 35 &  \\Xi 35 & \\zeta 35 \cr
  4705. }
  4706.  
  4707. \ifwritinganswers
  4708.    \let\next=\relax
  4709. \else
  4710.    \let\next=\endinput
  4711.    \datestamp
  4712. \fi
  4713.  
  4714. \next
  4715.  
  4716. \def\beginliteral{
  4717. \vskip\baselineskip
  4718. \begingroup
  4719. \obeylines
  4720. \tt
  4721. \catcode`\@=0\catcode`\~=12
  4722. \catcode`\$=12\catcode`\&=12\catcode`\^=12\catcode`\#=12
  4723. \catcode`\_=12\catcode`\=12
  4724. \def\par{\leavevmode\endgraf}
  4725. \catcode`\{=12\catcode`\}=12\catcode`\%=12\catcode`\\=12
  4726. }
  4727. \def\endliteral{\nobreak \vskip 6pt \endgroup}
  4728.  
  4729.  
  4730. \section{I get by with a little help}
  4731. Many of the exercises can be answered in several ways. If you
  4732. like your way better than the way given below, by all means use
  4733. it!
  4734. \vskip 2\baselineskip
  4735.  
  4736. \parskip=0pt \parindent=0pt
  4737. \raggedright
  4738. \hbadness=10000
  4739.  
  4740. \hrule
  4741. \beginliteral
  4742. I like \TeX!
  4743. Once you get the hang of it, \TeX{} is really easy to use.
  4744. You just have to master the \TeX nical aspects.
  4745. @endliteral
  4746. I like \TeX! Once you get the hang of it, \TeX{} is really easy
  4747. to use. You just have to master the \TeX nical aspects.
  4748. \vskip \baselineskip \hrule
  4749.  
  4750.  
  4751. \goodbreak \vskip 2pt \hrule
  4752. \beginliteral
  4753. Does \AE schylus understand \OE dipus?
  4754. @endliteral
  4755. Does \AE schylus understand \OE dipus?
  4756. \vskip \baselineskip \hrule
  4757.  
  4758. \goodbreak \vskip 2pt \hrule
  4759. \beginliteral
  4760. The smallest internal unit of \TeX{} is about 53.63\AA.
  4761. @endliteral
  4762. The smallest internal unit of \TeX{} is about 53.63\AA.
  4763. \vskip \baselineskip \hrule
  4764.  
  4765.  
  4766. \goodbreak \vskip 2pt \hrule
  4767. \beginliteral
  4768.  They took some honey and plenty of money wrapped up in a {\it \$}5 note.
  4769. @endliteral
  4770.  They took some honey and plenty of money wrapped up in a {\it \$}5 note.
  4771. \vskip \baselineskip \hrule
  4772.  
  4773.  
  4774. \goodbreak \vskip 2pt \hrule
  4775. \beginliteral
  4776.  \'El\`eves, refusez vos le\c cons! Jetez vos cha\^\i nes!
  4777. @endliteral
  4778.  \'El\`eves, refusez vos le\c cons! Jetez vos cha\^\i nes!
  4779. \vskip \baselineskip \hrule
  4780.  
  4781.  
  4782. \goodbreak \vskip 2pt \hrule
  4783. \beginliteral
  4784.  Za\v sto tako polako pijete \v caj?
  4785. @endliteral
  4786.  Za\v sto tako polako pijete \v caj?
  4787. \vskip \baselineskip \hrule
  4788.  
  4789.  
  4790. \goodbreak \vskip 2pt \hrule
  4791. \beginliteral
  4792.  Mein Tee ist hei\ss.
  4793. @endliteral
  4794.  Mein Tee ist hei\ss.
  4795. \vskip \baselineskip \hrule
  4796.  
  4797.  
  4798. \goodbreak \vskip 2pt \hrule
  4799. \beginliteral
  4800.  Peut-\^etre qu'il pr\'ef\`ere le caf\'e glac\'e.
  4801. @endliteral
  4802.  Peut-\^etre qu'il pr\'ef\`ere le caf\'e glac\'e.
  4803. \vskip \baselineskip \hrule
  4804.  
  4805. \goodbreak \vskip 2pt \hrule
  4806. \beginliteral
  4807. ?`Por qu/'e no bebes vino blanco? !`Porque est/'a avinagrado!
  4808. @endliteral
  4809. ?`Por qu/'e no bebes vino blanco? !`Porque est/'a avinagrado!
  4810. \vskip \baselineskip \hrule
  4811.  
  4812. \goodbreak \vskip 2pt \hrule
  4813. \beginliteral
  4814.  M\'\i\'\j n idee\"en wordt niet be\"\i nvloed.
  4815. @endliteral
  4816.  M\'\i\'\j n idee\"en wordt niet be\"\i nvloed.
  4817. \vskip \baselineskip \hrule
  4818.  
  4819.  
  4820.  
  4821. \goodbreak \vskip 2pt \hrule
  4822. \beginliteral
  4823.  Can you take a ferry from \"Oland to \AA land?
  4824. @endliteral
  4825.  Can you take a ferry from \"Oland to \AA land?
  4826. \vskip \baselineskip \hrule
  4827.  
  4828.  
  4829. \goodbreak \vskip 2pt \hrule
  4830. \beginliteral
  4831.  T\"urk\c ce konu\c san ye\u genler nasillar?
  4832. @endliteral
  4833.  T\"urk\c ce konu\c san ye\u genler nasillar?
  4834. \vskip \baselineskip \hrule
  4835.  
  4836.  
  4837.  
  4838.  
  4839. \goodbreak \vskip 2pt \hrule
  4840. \beginliteral
  4841.  I entered the room and---horrors---I saw both my father-in-law and my
  4842. mother-in-law.
  4843. @endliteral
  4844.  I entered the room and---horrors---I saw both my father-in-law and my
  4845. mother-in-law.
  4846. \vskip \baselineskip \hrule
  4847.  
  4848.  
  4849. \goodbreak \vskip 2pt \hrule
  4850. \beginliteral
  4851. The winter of 1484--1485 was one of discontent.
  4852. @endliteral
  4853. The winter of 1484--1485 was one of discontent.
  4854. \vskip \baselineskip \hrule
  4855.  
  4856.  
  4857. \goodbreak \vskip 2pt \hrule
  4858. \beginliteral
  4859. His ``thoughtfulness'' was impressive.
  4860. @endliteral
  4861. His ``thoughtfulness'' was impressive.
  4862. \vskip \baselineskip \hrule
  4863.  
  4864.  
  4865. \goodbreak \vskip 2pt \hrule
  4866. \beginliteral
  4867.  Frank wondered, ``Is this a girl that can't say `No!'?''
  4868. @endliteral
  4869.  Frank wondered, ``Is this a girl that can't say `No!'?''
  4870. \vskip \baselineskip \hrule
  4871.  
  4872.  
  4873. \goodbreak \vskip 2pt \hrule
  4874. \beginliteral
  4875.  He thought, ``\dots and this goes on forever, perhaps to the last recorded
  4876. syllable.''
  4877. @endliteral
  4878.  He thought, ``\dots and this goes on forever, perhaps to the last recorded
  4879. syllable.''
  4880. \vskip \baselineskip \hrule
  4881.  
  4882.  
  4883. \goodbreak \vskip 2pt \hrule
  4884. \beginliteral
  4885.  Have you seen Ms.~Jones?
  4886. @endliteral
  4887.  Have you seen Ms.~Jones?
  4888. \vskip \baselineskip \hrule
  4889.  
  4890.  
  4891. \goodbreak \vskip 2pt \hrule
  4892. \beginliteral
  4893. Prof.~Smith and Dr.~Gold flew from
  4894. Halifax N.~S. to Montr\'eal, P.~Q. via Moncton, N.~B.
  4895. @endliteral
  4896. Prof.~Smith and Dr.~Gold flew from
  4897. Halifax N.~S. to Montr\'eal, P.~Q. via Moncton, N.~B.
  4898. \vskip \baselineskip \hrule
  4899.  
  4900.  
  4901. \goodbreak \vskip 2pt \hrule
  4902. \beginliteral
  4903. \line{left end \hfil left tackle \hfil left guard \hfil @centre \hfil
  4904. right guard \hfil right tackle \hfil right end}
  4905. @endliteral
  4906. \line{left end \hfil left tackle \hfil left guard \hfil \centre{} \hfil
  4907. right guard \hfil right tackle \hfil right end}
  4908. \vskip \baselineskip \hrule
  4909.  
  4910.  
  4911. \goodbreak \vskip 2pt \hrule
  4912. \beginliteral
  4913. \line{left \hfil \hfil right-@centre \hfil right}
  4914. @endliteral
  4915. \line{left \hfil \hfil right-\centre{} \hfil right}
  4916. \vskip \baselineskip \hrule
  4917.  
  4918.  
  4919. \goodbreak \vskip 2pt \hrule
  4920. \beginliteral
  4921. \line{\hskip 1 in ONE \hfil TWO \hfil THREE}
  4922. @endliteral
  4923. \line{\hskip 1 in ONE \hfil TWO \hfil THREE}
  4924. \vskip \baselineskip \hrule
  4925.  
  4926.  
  4927. \goodbreak \vskip 2pt \hrule
  4928. \beginliteral
  4929. i{f}f if{}f if{f}
  4930. @endliteral
  4931. i{f}f if{}f if{f}
  4932. \vskip \baselineskip \hrule
  4933.  
  4934.  
  4935. \goodbreak \vskip 2pt \hrule
  4936. \beginliteral
  4937. I started with roman type {\it switched to italic type}, and
  4938. returned to roman type.
  4939. @endliteral
  4940. I started with roman type {\it switched to italic type}, and
  4941. returned to roman type.
  4942. \vskip \baselineskip \hrule
  4943.  
  4944.  
  4945. \goodbreak \vskip 2pt \hrule
  4946. \beginliteral
  4947. $C(n,r) = n!/(r!\,(n-r)!)$
  4948. @endliteral
  4949. $C(n,r) = n!/(r!\,(n-r)!)$
  4950. \vskip \baselineskip \hrule
  4951.  
  4952.  
  4953. \goodbreak \vskip 2pt \hrule
  4954. \beginliteral
  4955. $a+b=c-d=xy=w/z$
  4956. $$a+b=c-d=xy=w/z$$
  4957. @endliteral
  4958. $a+b=c-d=xy=w/z$
  4959. $$a+b=c-d=xy=w/z$$
  4960. \vskip \baselineskip \hrule
  4961.  
  4962.  
  4963. \goodbreak \vskip 2pt \hrule
  4964. \beginliteral
  4965. $(fg)' = f'g + fg'$
  4966. $$(fg)' = f'g + fg'$$
  4967. @endliteral
  4968. $(fg)' = f'g + fg'$
  4969. $$(fg)' = f'g + fg'$$
  4970. \vskip \baselineskip \hrule
  4971.  
  4972.  
  4973. \goodbreak \vskip 2pt \hrule
  4974. \beginliteral
  4975. $\alpha\beta=\gamma+\delta$
  4976. $$\alpha\beta=\gamma+\delta$$
  4977. @endliteral
  4978. $\alpha\beta=\gamma+\delta$
  4979. $$\alpha\beta=\gamma+\delta$$
  4980. \vskip \baselineskip \hrule
  4981.  
  4982.  
  4983. \goodbreak \vskip 2pt \hrule
  4984. \beginliteral
  4985. $\Gamma(n) = (n-1)!$
  4986. $$\Gamma(n) = (n-1)!$$
  4987. @endliteral
  4988. $\Gamma(n) = (n-1)!$
  4989. $$\Gamma(n) = (n-1)!$$
  4990. \vskip \baselineskip \hrule
  4991.  
  4992. \goodbreak \vskip 2pt \hrule
  4993. \beginliteral
  4994. $x\wedge (y\vee z) = (x\wedge y) \vee (x\wedge z)$
  4995. @endliteral
  4996. $x\wedge (y\vee z) = (x\wedge y) \vee (x\wedge z)$
  4997. \vskip \baselineskip \hrule
  4998.  
  4999. \goodbreak \vskip 2pt \hrule
  5000. \beginliteral
  5001. $2+4+6+\cdots +2n = n(n+1)$
  5002. @endliteral
  5003. $2+4+6+\cdots +2n = n(n+1)$
  5004. \vskip \baselineskip \hrule
  5005.  
  5006.  
  5007. \goodbreak \vskip 2pt \hrule
  5008. \beginliteral
  5009. $\vec x\cdot \vec y  = 0$ if and only if $\vec x \perp \vec y$.
  5010. @endliteral
  5011. $\vec x\cdot \vec y  = 0$ if and only if $\vec x \perp \vec y$.
  5012. \vskip \baselineskip \hrule
  5013.  
  5014.  
  5015. \goodbreak \vskip 2pt \hrule
  5016. \beginliteral
  5017. $\vec x\cdot \vec y \not= 0$ if and only if $\vec x \not\perp \vec y$.
  5018. @endliteral
  5019. $\vec x\cdot \vec y \not= 0$ if and only if $\vec x \not\perp \vec y$.
  5020. \vskip \baselineskip \hrule
  5021.  
  5022.  
  5023. \goodbreak \vskip 2pt \hrule
  5024. \beginliteral
  5025. $(\forall x\in \Re)(\exists y\in\Re)$ $y>x$.
  5026. @endliteral
  5027. $(\forall x\in \Re)(\exists y\in\Re)$ $y>x$.
  5028. \vskip \baselineskip \hrule
  5029.  
  5030.  
  5031. \goodbreak \vskip 2pt \hrule
  5032. \beginliteral
  5033. ${a+b\over c}\quad {a\over b+c}\quad {1\over a+b+c} \not= {1\over a}+
  5034. {1\over b}+{1\over c}$.
  5035. @endliteral
  5036. ${a+b\over c}\quad {a\over b+c}\quad {1\over a+b+c} \not= {1\over a}+
  5037. {1\over b}+{1\over c}$.
  5038. \vskip \baselineskip \hrule
  5039.  
  5040.  
  5041. \goodbreak \vskip 2pt \hrule
  5042. \beginliteral
  5043. What are the points where ${\partial \over \partial x} f(x,y) = {\partial \over
  5044. \partial y} f(x,y) = 0$?
  5045. @endliteral
  5046. What are the points where ${\partial \over \partial x} f(x,y) = {\partial \over
  5047. \partial y} f(x,y) = 0$?
  5048. \vskip \baselineskip \hrule
  5049.  
  5050.  
  5051. \goodbreak \vskip 2pt \hrule
  5052. \beginliteral
  5053. $e^x \quad e^{-x} \quad e^{i\pi}+1=0 \quad x_0 \quad x_0^2
  5054. \quad {x_0}^2 \quad 2^{x^x}$.
  5055. @endliteral
  5056. $e^x \quad e^{-x} \quad e^{i\pi}+1=0 \quad x_0 \quad x_0^2
  5057. \quad {x_0}^2 \quad 2^{x^x}$.
  5058. \vskip \baselineskip \hrule
  5059.  
  5060.  
  5061. \goodbreak \vskip 2pt \hrule
  5062. \beginliteral
  5063. $\nabla^2 f(x,y) = {\partial^2 f \over\partial x^2}+ {\partial^2 f \over
  5064. \partial y^2}$.
  5065. @endliteral
  5066. $\nabla^2 f(x,y) = {\partial^2 f \over\partial x^2}+ {\partial^2 f \over
  5067. \partial y^2}$.
  5068. \vskip \baselineskip \hrule
  5069.  
  5070.  
  5071. \goodbreak \vskip 2pt \hrule
  5072. \beginliteral
  5073. $\lim_{x\to 0} (1+x)^{1\over x}=e$.
  5074. @endliteral
  5075. $\lim_{x\to 0} (1+x)^{1\over x}=e$.
  5076. \vskip \baselineskip \hrule
  5077.  
  5078.  
  5079. \goodbreak \vskip 2pt \hrule
  5080. \beginliteral
  5081. The cardinality of $(-\infty, \infty)$ is $\aleph_1$.
  5082. @endliteral
  5083. The cardinality of $(-\infty, \infty)$ is $\aleph_1$.
  5084. \vskip \baselineskip \hrule
  5085.  
  5086.  
  5087. \goodbreak \vskip 2pt \hrule
  5088. \beginliteral
  5089. $\lim_{x\to {0^+}} x^x = 1$.
  5090. @endliteral
  5091. $\lim_{x\to {0^+}} x^x = 1$.
  5092. \vskip \baselineskip \hrule
  5093.  
  5094.  
  5095. \goodbreak \vskip 2pt \hrule
  5096. \beginliteral
  5097. $\int_0^1 3x^2\,dx = 1$.
  5098. @endliteral
  5099. $\int_0^1 3x^2\,dx = 1$.
  5100. \vskip \baselineskip \hrule
  5101.  
  5102.  
  5103. \goodbreak \vskip 2pt \hrule
  5104. \beginliteral
  5105. $\sqrt2 \quad \sqrt {x+y\over x-y} \quad \root 3 \of {10}$ \quad $e^{\sqrt x}$.
  5106. @endliteral
  5107. $\sqrt2 \quad \sqrt {x+y\over x-y} \quad \root 3 \of {10}$ \quad $e^{\sqrt x}$.
  5108. \vskip \baselineskip \hrule
  5109.  
  5110.  
  5111. \goodbreak \vskip 2pt \hrule
  5112. \beginliteral
  5113. $\|x\| = \sqrt{x\cdot x}$.
  5114. @endliteral
  5115. $\|x\| = \sqrt{x\cdot x}$.
  5116. \vskip \baselineskip \hrule
  5117.  
  5118.  
  5119. \goodbreak \vskip 2pt \hrule
  5120. \beginliteral
  5121. $\phi(t) = {1 \over \sqrt{2\pi}} \int_0^t e^{-x^2/2}\,dx$.
  5122. @endliteral
  5123. $\phi(t) = {1 \over \sqrt{2\pi}} \int_0^t e^{-x^2/2}\,dx$.
  5124. \vskip \baselineskip \hrule
  5125.  
  5126.  
  5127. \goodbreak \vskip 2pt \hrule
  5128. \beginliteral
  5129. $\underline x \quad \overline y \quad \underline{\overline{x+y}}$.
  5130. @endliteral
  5131. $\underline x \quad \overline y \quad \underline{\overline{x+y}}$.
  5132. \vskip \baselineskip \hrule
  5133.  
  5134.  
  5135. \goodbreak \vskip 2pt \hrule
  5136. \beginliteral
  5137. $\bigl \lceil \lfloor x \rfloor \bigr \rceil \leq \bigl \lfloor \lceil x \rceil
  5138. \bigr \rfloor$.
  5139. @endliteral
  5140. $\bigl \lceil \lfloor x \rfloor \bigr \rceil \leq \bigl \lfloor \lceil x \rceil
  5141. \bigr \rfloor$.
  5142. \vskip \baselineskip \hrule
  5143.  
  5144.  
  5145. \goodbreak \vskip 2pt \hrule
  5146. \beginliteral
  5147. $\sin(2\theta) = 2\sin\theta\cos\theta
  5148. \quad \cos(2\theta) = 2\cos^2\theta - 1  $.
  5149. @endliteral
  5150. $\sin(2\theta) = 2\sin\theta\cos\theta
  5151. \quad \cos(2\theta) = 2\cos^2\theta - 1  $.
  5152. \vskip \baselineskip \hrule
  5153.  
  5154.  
  5155. \goodbreak \vskip 2pt \hrule
  5156. \beginliteral
  5157. $$\int \csc^2x\, dx = -\cot x+ C
  5158. \qquad \lim_{\alpha\to 0} {\sin\alpha \over \alpha} = 1
  5159. \qquad \lim_{\alpha\to \infty} {\sin\alpha \over \alpha} = 0.$$
  5160. @endliteral
  5161. $$\int \csc^2x\, dx = -\cot x+ C
  5162. \qquad \lim_{\alpha\to 0} {\sin\alpha \over \alpha} = 1
  5163. \qquad \lim_{\alpha\to \infty} {\sin\alpha \over \alpha} = 0.$$
  5164. \vskip \baselineskip \hrule
  5165.  
  5166.  
  5167. \goodbreak \vskip 2pt \hrule
  5168. \beginliteral
  5169. $$\tan(2\theta) = {2\tan\theta \over 1-\tan^2\theta}.$$
  5170. @endliteral
  5171. $$\tan(2\theta) = {2\tan\theta \over 1-\tan^2\theta}.$$
  5172. \vskip \baselineskip \hrule
  5173.  
  5174.  
  5175. \goodbreak \vskip 2pt \hrule
  5176. \beginliteral
  5177. \proclaim Theorem (Euclid). There exist an infinite number of primes.
  5178. @endliteral
  5179. \proclaim Theorem (Euclid). There exist an infinite number of primes.
  5180.  
  5181. \vskip \baselineskip \hrule
  5182.  
  5183.  
  5184. \goodbreak \vskip 2pt \hrule
  5185. \beginliteral
  5186. \proclaim Proposition 1.
  5187. $\root n \of {\prod_{i=1}^n X_i} \leq
  5188. {1 \over n} \sum_{i=1}^n X_i$ with equality if and only if $X_1=\cdots=X_n$.
  5189. @endliteral
  5190. \proclaim Proposition 1.
  5191. $\root n \of {\prod_{i=1}^n X_i} \leq
  5192. {1 \over n} \sum_{i=1}^n X_i$ with equality if and only if $X_1=\cdots=X_n$.
  5193.  
  5194. \vskip \baselineskip \hrule
  5195.  
  5196.  
  5197.  
  5198. \goodbreak \vskip 2pt \hrule
  5199. \beginliteral
  5200. $$ I_4 = \pmatrix{
  5201. 1 &0 &0 &0 \cr
  5202. 0 &1 &0 &0 \cr
  5203. 0 &0 &1 &0 \cr
  5204. 0 &0 &0 &1 \cr}$$
  5205. @endliteral
  5206. $$ I_4 = \pmatrix{
  5207. 1 &0 &0 &0 \cr
  5208. 0 &1 &0 &0 \cr
  5209. 0 &0 &1 &0 \cr
  5210. 0 &0 &0 &1 \cr}$$
  5211. \vskip \baselineskip \hrule
  5212.  
  5213.  
  5214. \goodbreak \vskip 2pt \hrule
  5215. \beginliteral
  5216. $$ |x| = \left\{ \matrix{
  5217. x & x \ge 0 \cr
  5218. -x & x \le 0 \cr} \right.$$
  5219. @endliteral
  5220. $$ |x| = \left\{ \matrix{
  5221. x & x \ge 0 \cr
  5222. -x & x \le 0 \cr} \right.$$
  5223. \vskip \baselineskip \hrule
  5224.  
  5225. \goodbreak \vskip 2pt \hrule
  5226. \beginliteral
  5227. \settabs \+ \hskip 2 in & \hskip .75in & \hskip 1cm& \cr
  5228. \+ &Plums &\hfill\$1&.22 \cr
  5229. \+ &Coffee &\hfill1&.78 \cr
  5230. \+ &Granola &\hfill1&.98 \cr
  5231. \+ &Mushrooms & &.63 \cr
  5232. \+ &{Kiwi fruit} & &.39 \cr
  5233. \+ &{Orange juice} &\hfill1&.09 \cr
  5234. \+ &Tuna &\hfill1&.29 \cr
  5235. \+ &Zucchini & &.64 \cr
  5236. \+ &Grapes &\hfill1&.69 \cr
  5237. \+ &{Smoked beef} & &.75 \cr
  5238. \+ &Broccoli &\hfill\underbar{\ \ 1}&\underbar{.09} \cr
  5239. \+ &Total &\hfill \$12&.55 \cr
  5240. @endliteral
  5241. \settabs \+ \hskip 2 in & \hskip .75in & \hskip 1cm& \cr
  5242. \+ &Plums &\hfill\$1&.22 \cr
  5243. \+ &Coffee &\hfill1&.78 \cr
  5244. \+ &Granola &\hfill1&.98 \cr
  5245. \+ &Mushrooms & &.63 \cr
  5246. \+ &{Kiwi fruit} & &.39 \cr
  5247. \+ &{Orange juice} &\hfill1&.09 \cr
  5248. \+ &Tuna &\hfill1&.29 \cr
  5249. \+ &Zucchini & &.64 \cr
  5250. \+ &Grapes &\hfill1&.69 \cr
  5251. \+ &{Smoked beef} & &.75 \cr
  5252. \+ &Broccoli &\hfill\underbar{\ \ 1}&\underbar{.09} \cr
  5253. \+ &Total &\hfill \$12&.55 \cr
  5254. \vskip \baselineskip \hrule
  5255.  
  5256.  
  5257. \goodbreak \vskip 2pt \hrule
  5258. \beginliteral
  5259. \settabs \+ \hskip 4.5 in & \cr
  5260. \+Getting Started \dotfill &1 \cr
  5261. \+All Characters Great and Small \dotfill &9 \cr
  5262. @endliteral
  5263. \settabs \+ \hskip 4.5 in & \cr
  5264. \+Getting Started \dotfill &1 \cr
  5265. \+All Characters Great and Small \dotfill &9 \cr
  5266. \vskip \baselineskip \hrule
  5267.  
  5268. \goodbreak \vskip 2pt \hrule
  5269. \beginliteral
  5270. \settabs \+ \hskip 1cm&\hskip 1 cm&\hskip 1 cm& \cr
  5271. \moveright 2 in
  5272. \vbox{
  5273. \hrule width 3 cm
  5274. \+  \vrule height 1 cm & \vrule height 1 cm & \vrule height 1 cm
  5275.   & \vrule height 1 cm \cr
  5276. \hrule width 3 cm
  5277. \+  \vrule height 1 cm & \vrule height 1 cm & \vrule height 1 cm
  5278.   & \vrule height 1 cm \cr
  5279. \hrule width 3 cm
  5280. \+  \vrule height 1 cm & \vrule height 1 cm & \vrule height 1 cm
  5281.   & \vrule height 1 cm \cr
  5282. \hrule width 3 cm
  5283. }
  5284. @endliteral
  5285. \settabs \+ \hskip 1cm&\hskip 1 cm&\hskip 1 cm& \cr
  5286. \moveright 2 in
  5287. \vbox{
  5288. \hrule width 3 cm
  5289. \+  \vrule height 1 cm & \vrule height 1 cm & \vrule height 1 cm
  5290.   & \vrule height 1 cm \cr
  5291. \hrule width 3 cm
  5292. \+  \vrule height 1 cm & \vrule height 1 cm & \vrule height 1 cm
  5293.   & \vrule height 1 cm \cr
  5294. \hrule width 3 cm
  5295. \+  \vrule height 1 cm & \vrule height 1 cm & \vrule height 1 cm
  5296.   & \vrule height 1 cm \cr
  5297. \hrule width 3 cm
  5298. }
  5299. \vskip \baselineskip \hrule
  5300.  
  5301.  
  5302. \goodbreak \vskip 2pt \hrule
  5303. \beginliteral
  5304. \def\boxtext#1{%
  5305. \vbox{%
  5306.       \hrule
  5307.       \hbox{\strut \vrule{} #1 \vrule}%
  5308.       \hrule
  5309.      }%
  5310. }
  5311. \moveright 2 in \vbox{\offinterlineskip
  5312. \hbox{\boxtext{6}\boxtext{1}\boxtext {8}}
  5313. \hbox{\boxtext{7}\boxtext{5}\boxtext{3}}
  5314. \hbox{\boxtext{2}\boxtext{9}\boxtext{4}}
  5315. }
  5316. @endliteral
  5317. \def\boxtext#1{%
  5318. \vbox{%
  5319.       \hrule
  5320.       \hbox{\strut \vrule{} #1 \vrule}%
  5321.       \hrule
  5322.      }%
  5323. }
  5324. \moveright 2 in \vbox{\offinterlineskip
  5325. \hbox{\boxtext 6\boxtext 1\boxtext 8}
  5326. \hbox{\boxtext 7\boxtext 5\boxtext 3}
  5327. \hbox{\boxtext 2\boxtext 9\boxtext 4}
  5328. }
  5329. \vskip \baselineskip \hrule
  5330.  
  5331.  
  5332. \vfill
  5333. \datestamp
  5334.  
  5335. \bye
  5336.